time-to-botec/js/node_modules/@stdlib/assert/is-node-builtin
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
bin feat: add the node modules 2022-12-03 12:44:49 +00:00
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
etc feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

isNodeBuiltin

Test whether a string matches a Node.js built-in module name.

Usage

var isNodeBuiltin = require( '@stdlib/assert/is-node-builtin' );

isNodeBuiltin( value )

Tests whether a string matches a Node.js built-in module name.

var bool = isNodeBuiltin( 'util' );
// returns true

Notes

  • For non-string values, the function returns false.

Examples

var isNodeBuiltin = require( '@stdlib/assert/is-node-builtin' );

var out = isNodeBuiltin( 'fs' );
// returns true

out = isNodeBuiltin( 'child_process' );
// returns true

out = isNodeBuiltin( 'fs-extra' );
// returns false

out = isNodeBuiltin( 'moment' );
// returns false

CLI

Usage

Usage: is-node-builtin [options] [<string>]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.

Examples

$ is-node-builtin crypto
true

To use as a standard stream,

$ echo -n 'crypto\ncluster\nfs-extra' | is-node-builtin
true
true
false