get-intrinsic
npmv1.3.0Get and robustly cache all JS language-level intrinsics at first require time
Adopt with care
get-intrinsic is usable, with caveats. Last published 564 days ago. 5 releases in the last 2 years.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- CMaintenance: grade C, Fair — worth a look.
Last published 564 days ago. 5 releases in the last 2 years.
- BWeight: grade B, Good.
Pulls in 10 transitive packages, about 162 KB installed (at least — some of the tree is still being crawled).
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding get-intrinsic to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Part of this dependency tree has not been crawled yet, so these figures are a lower bound rather than a final total.
Licenses in the dependency tree
Every license you inherit by installing get-intrinsic, not just its own. Check this before a legal review, not after.
Compatibility
- Node.js
- node >= 0.4
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the get-intrinsic README.
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);
// instance methods
var arr = [1];
assert.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push);
assert.deepEqual(arr, [1]);get-intrinsic vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| get-intrinsicthis page | 0 | 8 | MIT | 1 year ago |
| call-bind | 80.7M | 5 | MIT | 1 day ago |
| call-bound | 0 | 7 | MIT | 1 day ago |
| eslint | 138.4M | 279 | MIT | 1 day ago |
| es-define-property | 131.3M | 4 | MIT | 1 day ago |
| internal-slot | 79.2M | 1 | MIT | 1 day ago |
Dependencies
Declared by get-intrinsic v1.3.0. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (10)
Dev (18)
Used by
Popular packages that depend on get-intrinsic.
Robustly `.call.bind()` a function
Store information about any JS value in a side channel. Uses WeakMap if available.
Store information about any JS value in a side channel, using a Map
Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.
Get an iterator for any JS language value. Works robustly across all environments, all versions.
A helper to optimistically set Symbol.toStringTag, when possible.
Set a function's length property
node's assert.deepEqual algorithm
Relationship graph
Dependencies (left) and dependents (right) of get-intrinsic.
Frequently installed together
An AST-based pattern checker for JavaScript.
string representations of objects in node and the browser
A simple cache for a few of the JS Error constructors.
Robustly `.call.bind()` a function
Array#isArray for older browsers
Is this an arguments object? It's a harder question than you think.
`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.
Helper functions around Function call/apply/bind, for use in `call-bind`
Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.
`Object.defineProperty`, but not IE 8's broken one.
Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag
Firefox 17-26 iterators throw a StopIteration object to indicate "done". This normalizes it.
Release history
5 releases in the last two years, typically about 97 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.3.1 | 11 months ago | 46 KB | MIT |
| 1.3.0latest | 1 year ago | 45 KB | MIT |
| 1.2.7 | 1 year ago | 45 KB | MIT |
| 1.2.6 | 1 year ago | 44 KB | MIT |
| 1.2.5 | 1 year ago | 43 KB | MIT |
| 1.2.4 | 2 years ago | 41 KB | MIT |
| 1.2.3 | 2 years ago | 40 KB | MIT |
| 1.2.2 | 2 years ago | 39 KB | MIT |
| 1.2.1 | 3 years ago | 38 KB | MIT |
| 1.2.0 | 3 years ago | 38 KB | MIT |
| 1.1.3 | 4 years ago | 36 KB | MIT |
| 1.1.2 | 4 years ago | 36 KB | MIT |
| 1.1.1 | 5 years ago | 32 KB | MIT |
| 1.1.0 | 5 years ago | 29 KB | MIT |
| 1.0.2 | 5 years ago | 91 KB | MIT |
Overview
get-intrinsic is an npm package that get and robustly cache all JS language-level intrinsics at first require time. It has 8 known dependents in the graph. The latest version is 1.3.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need get and robustly cache all JS language-level intrinsics at first require time and value a focused solution.
When not to use it
Consider an alternative if you need to minimize your dependency tree, have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Clear open-source license (MIT).
Cons
- Large dependency tree (28 direct dependencies) increases install size and audit surface.
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Funding
Frequently asked questions
Should I use get-intrinsic?
get-intrinsic is usable, with caveats. Last published 564 days ago. 5 releases in the last 2 years.
How do I install get-intrinsic?
Run `npm install get-intrinsic` to add get-intrinsic to your npm project.
How many dependencies does get-intrinsic have?
get-intrinsic declares 28 direct dependencies and pulls in 10 packages in total once its runtime tree is resolved totalling about 162 KB on disk.
What license is get-intrinsic released under?
get-intrinsic is distributed under the MIT license.
How popular is get-intrinsic?
npm does not publish download counts. Within PackageGraph's crawl, 8 known packages depend on get-intrinsic.
Is get-intrinsic still maintained?
The most recent release of get-intrinsic (v1.3.0) was published 1 year ago.
Does get-intrinsic run install scripts?
No. get-intrinsic does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.