inspect-js
This github and npm organization houses JavaScript projects that help you look at stuff.
Predicates
Functions that ask a question and produce a yes or no answer (`true` or `false`).
- is-arguments -
-
- Is this an arguments object? It's a harder question than you think.
- 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-date-object -
-
- Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
- 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-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?
Comparisons
Packages that compare two things.
Environment
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-object-spread -
-
- check if the environment supports { ...a } spread syntax
- has-optional-chaining -
-
- Determine if the JS environment has optional chaining support
- 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-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?
- 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.
Describe
Packages that tell you about a specific JS value.
- 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-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.