package
Get and robustly cache all JS language-level intrinsics at first require time
npm install get-intrinsicGitHub-flavored package documentation.
Across all versions, last 30 days.
1,087,972,136 in 30 days
Runtime metadata.
Tagged topics.
Get and robustly cache all JS language-level intrinsics at first require time.
See the syntax described in the JS spec for reference.
var GetIntrinsic = require('get-intrinsic');
var assert = require('assert');
// static methods
assert.equal(GetIntrinsic('%Math.pow%'), Math.pow);
assert.equal(Math.pow(2, 3), 8);
assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8);
delete Math.pow;
assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8);
Simply clone the repo, npm install, and run npm test
Please email @ljharb or see https://tidelift.com/security if you have a potential security vulnerability to report.
Estimated unpacked size across 10 packages.
178.6 kB
Includes dependencies.
10 direct dependencies.
^1.2.0
1.2.0
^2.0.2
2.0.4
^1.3.0
1.3.0
^1.0.1
1.0.1
^1.1.0
1.1.0
1.0.1
^1.0.2
1.0.2