npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

is-all-utils

v1.0.7

Published

Is utils functions for validate !

Downloads

825

Readme

Is all utils, +32 functions

Some functions to validate the type, and they are very light; take a look at the documentation!

Installation

npm install --save is-all-utils

# Or

yarn add is-all-utils

Usage

For import with typescript or ES6+

import { isNil /* ...more functions */ } from 'is-all-utils';

For import with javascript standar or ES5-

const is = require('is-all-utils');

// Use with javascript standar
is.isNil;
// Number
isNumber(546); //=> true
isNumber(76.945); //=> true
isNumber(Number); //=> false
isNumber(Number(7)); //=> true
isNumber(new Date().getTime()); //=> true

isInteger(654); //=> true
isInteger(654.645); //=> false

isFloat(546); //=> false
isFloat(546.9465); //=> true
isFloat(546.0); //=> false

// Object
isObj({}); //=> true
isObj([]); //=> true
isObj(Array(7, 18)); //=> true

isObject([]); //=> false
isObject({}); //=> true
isObject(Object); //=> false

isArray({}); //=> false
isArray([]); //=> true
isArray(Array); //=> false
isArray(Array(7, 18)); //=> true

isString('Hello World !'); //=> true
isString(String('Hello World !')); //=> true
isString(String); //=> false

isRegExp(/7/g); //=> true
isRegExp(RegExp('7', 'g')); //=> true
isRegExp(RegExp); //=> false

isBoolean(true); //=> true
isBoolean(false); //=> true
isBoolean(1); //=> false
isBoolean(Boolean(1)); //=> true

isBool(true); //=> true
isBool(1); //=> true
isBool(0); //=> true
isBool(false); //=> true

// Map
isMap(new Map()); //=> true
isMap(Map); //=> false
isMap(new Map(Object.entries({ twitter: '@yonycalsin' }))); //=> true

// WeakMap
isWeakMap(new WeakMap()); //=> true
isWeakMap(new Map()); //=> false

// Set
isSet(new Set()); //=> true
isSet(Set); //=> false

// WeakSet
isWeakSet(new WeakSet()); //=> true
isWeakSet(new Map()); //=> false
isWeakSet(new Set()); //=> false

// Undefined
isUndefined(undefined); //=> true
isUndefined(null); //=> false

isNull(undefined); //=> false
isNull(null); //=> true

isNil(undefined); //=> true
isNil(null); //=> true

// Function
isFunction(() => {}); //=> true
isFunction(class {}); //=> true
isFunction(async () => {}); //=> false
isFunction(Function); //=> true

isAsyncFunction(async () => {}); //=> true
isAsyncFunction(() => {}); //=> false

isFn(() => {}); //=> true
isFn(async () => {}); //=> true
isFn(class {}); //=> true
isFn(Number); //=> true
isFn(Number); //=> true
isFn(Function); //=> true

isClass(class {}); //=> true
isClass(() => {}); //=> false

isSymbol(Symbol()); //=> true
isSymbol(class {}); //=> false
isSymbol(Symbol); //=> false

// Error, Date
isError(new Error('Hi, Error ❓')); //=> true
isError(Error); //=> false

isDate(new Date()); //=> true
isDate(new Date().getTime()); //=> false
isDate(Date); //=> false

isPromise(new Promise(() => {})); //=> true
isPromise(async () => {}); //=> false
isPromise((async () => {})()); //=> true
isPromise(Promise); //=> false

⭐ Support for

is-all-utils is an open source project licensed by MIT. You can grow thanks to the sponsors and the support of the amazing sponsors. If you want to join them, contact me here.

🎩 Stay in touch

Contributors

Thanks to the wonderful people who collaborate with me !

📜 License

is-all-utils under License MIT.