This github and npm organization houses JavaScript projects that help you look at stuff.
Functions that ask a question and produce a yes or no answer (`true` or `false`).
- defined -
-
- return the first argument that is
!== undefined
- is-accessor-descriptor -
-
- Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.
- is-arguments -
-
- Is this an arguments object? It's a harder question than you think.
- is-array-buffer -
-
- Is this value a JS ArrayBuffer?
- is-arrow-function -
-
- Determine if a function is an ES6 arrow function or not.
- is-async-function -
-
- Determine if a function is a native async function.
- is-bigint -
-
- Is this value an ES BigInt?
- is-boolean-object -
-
- Is this value a JS Boolean? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
- is-boxed-primitive -
-
- Is this value a boxed primitive? Shim for node's util.isBoxedPrimitive.
- is-callable -
-
- Is this JS value callable? Works with Functions and GeneratorFunctions, despite ES6 @@toStringTag.
- is-core-module -
-
- Is this specifier a node.js core module?
- is-data-descriptor -
-
- Returns true if a value has the characteristics of a valid JavaScript data descriptor.
- is-data-view -
-
- Is this value a JS DataView? This module works cross-realm/iframe, does not depend on
instanceof
or mutable properties, and despite ES6 Symbol.toStringTag. - is-date-object -
-
- Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
- is-descriptor -
-
- Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.
- is-finalizationregistry -
-
- Is this value a JS FinalizationRegistry? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
- is-generator-function -
-
- Determine if a function is a native generator function.
- is-map -
-
- Is this value a JS Map? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
- is-negative-zero -
-
- Is this value negative zero? === will lie to you
- is-number-object -
-
- Is this value a JS Number object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
- is-object -
-
- Checks whether a value is an object
- is-package-root -
-
- Is this directory path the root of a package?
- is-regex -
-
- Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag
- is-registered-symbol -
-
- Is this value a Symbol stored in the global cross-realm Symbol registry?
- is-set -
-
- Is this value a JS Set? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
- is-shared-array-buffer -
-
- Is this value a JS SharedArrayBuffer?
- is-string -
-
- Is this value a JS String object or primitive? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
- is-symbol -
-
- Determine if a value is an ES6 Symbol or not.
- is-typed-array -
-
- Is this value a JS Typed Array? This module works cross-realm/iframe, does not depend on
instanceof
or mutable properties, and despite ES6 Symbol.toStringTag. - is-weakmap -
-
- Is this value a JS WeakMap? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
- is-weakref -
-
- Is this value a JS WeakRef? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
- is-weakset -
-
- Is this value a JS WeakSet? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
- is-well-known-symbol -
-
- Is this value a well-known Symbol?
Packages that compare two things.
Packages that tell you about the JS env.
- available-regexp-flags -
-
- Which regular expression flags does the current environment support?
- available-typed-arrays -
-
- Returns an array of Typed Array names that are available in the current environment
- functions-have-names -
-
- Does this JS environment support the
name
property on functions? - has-bigints -
-
- Determine if the JS environment has BigInt support.
- has-dynamic-import -
-
- Does the current environment have
import()
support? - has-named-captures -
-
- Does the JS environment support named capture groups in regexes?
- has-object-spread -
-
- check if the environment supports { ...a } spread syntax
- has-optional-chaining -
-
- Determine if the JS environment has optional chaining support
- has-override-mistake -
-
- Determine whether the environment has the so-called "override mistake" - [[Set]]ing a property whose ancestor is nonwritable throws.
- has-package-exports -
-
- Does the current node version have support for the "exports" field in package.json?
- has-package-imports -
-
- Does the current node version have support for the "imports" field in package.json?
- has-package-self-reference -
-
- Does the current node version have support for requiring/importing its own name?
- has-private-fields -
-
- Determine if the JS environment has private fields (
class { #x; }
) support. - has-property-descriptors -
-
- Does the environment have full property descriptor support? Handles IE 8's broken defineProperty/gOPD.
- has-proto -
-
- Does this environment have the ability to get the [[Prototype]] of an object on creation with
__proto__
? - has-strict-mode -
-
- Does the current JS environment have strict mode? ES5+ should; but let's not assume.
- has-symbols -
-
- Determine if the JS environment has Symbol support. Supports spec, or shams.
- has-template-literals -
-
- Determine if the JS environment has template literal support.
- has-tostringtag -
-
- Determine if the JS environment has
Symbol.toStringTag
support. Supports spec, or shams. - has-typed-arrays -
-
- Does this environment have JS Typed Arrays?
- hasown -
-
- A robust, ES3 compatible, "has own property" predicate.
- node-exports-info -
-
- Info about node
exports
field support: version ranges, categories, etc. - supports-preserve-symlinks-flag -
-
- Determine if the current node version supports the
--preserve-symlinks
flag.
Packages that tell you about a specific JS value.
- array-buffer-byte-length -
-
- Get the byte length of an ArrayBuffer, even in engines without a
.byteLength
method. - data-view-buffer -
-
- Get the ArrayBuffer out of a DataView, robustly.
- data-view-byte-length -
-
- Get the byteLength out of a DataView, robustly.
- data-view-byte-offset -
-
- Get the byteOffset out of a DataView, robustly.
- get-symbol-description -
-
- Gets the description of a Symbol. Handles
Symbol()
vsSymbol('')
properly when possible. - object-inspect -
-
- string representations of objects in node and the browser
- typed-array-buffer -
-
- Get the ArrayBuffer out of a TypedArray, robustly.
- typed-array-byte-length -
-
- Robustly get the byte length of a Typed Array
- typed-array-byte-offset -
-
- Robustly get the byte offset of a Typed Array
- typed-array-length -
-
- Robustly get the length of a Typed Array
- which-boxed-primitive -
-
- Which kind of boxed JS primitive is this?
- which-builtin-type -
-
- What is the type of this builtin JS value?
- which-collection -
-
- Which kind of Collection (Map, Set, WeakMap, WeakSet) is this JavaScript value? Works cross-realm, without
instanceof
, and despite Symbol.toStringTag. - which-typed-array -
-
- Which kind of Typed Array is this JavaScript value? Works cross-realm, without
instanceof
, and despite Symbol.toStringTag.