reusify
npmv1.1.0TypeScriptReuse objects and functions with style
Adopt with care
reusify is usable, with caveats. Last published 561 days ago.
- AAdoption: grade A, Excellent.
91M downloads per week and 1 known dependents.
- CMaintenance: grade C, Fair — worth a look.
Last published 561 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 11 KB installed.
- 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 reusify 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.
Compatibility
- Node.js
- iojs >=1.0.0, node >=0.10.0
- Module format
- CommonJS only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the reusify README.
var reusify = require('reusify')
var fib = require('reusify/benchmarks/fib')
var instance = reusify(MyObject)
// get an object from the cache,
// or creates a new one when cache is empty
var obj = instance.get()
// set the state
obj.num = 100
obj.func()
// reset the state.
// if the state contains any external objectreusify 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 |
|---|---|---|---|---|
| reusifythis page | 91M | 1 | MIT | 1 year ago |
| rfdc | 46.8M | 3 | MIT | 1 day ago |
| generate-function | 12M | 1 | MIT | 1 day ago |
| define-lazy-prop | 0 | 1 | MIT | 1 day ago |
| @nodable/entities | 0 | 2 | MIT | 1 day ago |
| callsites | 136.7M | 1 | MIT | 1 day ago |
Dependencies
Declared by reusify v1.1.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (7)
Used by
Popular packages that depend on reusify.
Relationship graph
Dependencies (left) and dependents (right) of reusify.
Frequently installed together
Release history
1 release in the last two years, typically about 112 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.1.0latest | 1 year ago | 11 KB | MIT |
| 1.0.4 | 8 years ago | — | MIT |
| 1.0.3 | 9 years ago | — | MIT |
| 1.0.2 | 9 years ago | — | MIT |
| 1.0.1 | 10 years ago | — | MIT |
| 1.0.0 | 11 years ago | — | MIT |
Overview
reusify is an npm package that reuse objects and functions with style. It is extremely widely used, with about 91M downloads per week and 1 known dependents in the graph. The latest version is 1.1.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need reuse objects and functions with style and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (91M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use reusify?
reusify is usable, with caveats. Last published 561 days ago.
How do I install reusify?
Run `npm install reusify` to add reusify to your npm project.
What license is reusify released under?
reusify is distributed under the MIT license.
How popular is reusify?
reusify has approximately 91,012,364 downloads per week and 1 known dependent packages.
Is reusify still maintained?
The most recent release of reusify (v1.1.0) was published 1 year ago.
Does reusify run install scripts?
No. reusify does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.