memoize-one
npmv6.0.0TypeScriptA memoization library which only remembers the latest invocation
Not recommended for new projects
No — memoize-one should not be adopted for new projects. Last published 1786 days ago.
- AAdoption: grade A, Excellent.
32.7M downloads per week and 3 known dependents.
- FMaintenance: grade F, Failing.
Last published 1786 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 35 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 memoize-one 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
- No constraint declared
- Module format
- ESM + CommonJS
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the memoize-one README.
// memoize-one uses the default import
import memoizeOne from 'memoize-one';
function add(a, b) {
return a + b;
}
const memoizedAdd = memoizeOne(add);
memoizedAdd(1, 2);
// add function: is called
// [new value returned: 3]
memoizedAdd(1, 2);
// add function: not calledmemoize-one 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 |
|---|---|---|---|---|
| memoize-onethis page | 32.7M | 3 | MIT | 4 years ago |
| define-lazy-prop | 0 | 1 | MIT | 1 day ago |
| file-entry-cache | 134.5M | 1 | MIT | 1 day ago |
| reusify | 91M | 1 | MIT | 1 day ago |
| rfdc | 46.8M | 3 | MIT | 1 day ago |
| make-fetch-happen | 22.8M | 1 | ISC | 1 day ago |
Dependencies
Declared by memoize-one v6.0.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (36)
Used by
Popular packages that depend on memoize-one.
Relationship graph
Dependencies (left) and dependents (right) of memoize-one.
Frequently installed together
React is a JavaScript library for building user interfaces.
TypeScript definitions for react
flow typed nullthrows
Color normalization for React Native.
the complete solution for node.js command-line programs
A low level parser for ANSI sequences.
Stringify any JavaScript value.
The hermes compiler CLI used during the React Native build process
A fast and minimal alternative to globby and fast-glob
The semantic version parser used by npm.
React is a JavaScript library for building user interfaces.
Cooperative scheduler for the browser environment.
Release history
No releases in the last two years, typically about 2 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 6.0.0latest | 4 years ago | 35 KB | MIT |
| 6.0.0-beta.1 | 4 years ago | 32 KB | MIT |
| 5.2.1 | 5 years ago | 21 KB | MIT |
| 5.2.0 | 5 years ago | 22 KB | MIT |
| 5.1.1 | 7 years ago | 18 KB | MIT |
| 5.1.0 | 7 years ago | 18 KB | MIT |
| 5.1.0-beta.6 | 7 years ago | 18 KB | MIT |
| 5.1.0-beta.5 | 7 years ago | 18 KB | MIT |
| 5.1.0-beta.4 | 7 years ago | 18 KB | MIT |
| 5.1.0-beta.3 | 7 years ago | 19 KB | MIT |
| 5.1.0-beta.2 | 7 years ago | 19 KB | MIT |
| 5.1.0-beta.1 | 7 years ago | 18 KB | MIT |
| 5.0.5 | 7 years ago | 17 KB | MIT |
| 5.0.4 | 7 years ago | 17 KB | MIT |
| 5.0.3 | 7 years ago | 17 KB | MIT |
Overview
memoize-one is an npm package that a memoization library which only remembers the latest invocation. It is extremely widely used, with about 32.7M downloads per week and 3 known dependents in the graph. The latest version is 6.0.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need a memoization library which only remembers the latest invocation and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to minimize your dependency tree, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (32.7M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- Large dependency tree (36 direct dependencies) increases install size and audit surface.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use memoize-one?
No — memoize-one should not be adopted for new projects. Last published 1786 days ago.
How do I install memoize-one?
Run `npm install memoize-one` to add memoize-one to your npm project.
What license is memoize-one released under?
memoize-one is distributed under the MIT license.
How popular is memoize-one?
memoize-one has approximately 32,692,602 downloads per week and 3 known dependent packages.
Is memoize-one still maintained?
The most recent release of memoize-one (v6.0.0) was published 4 years ago.
Does memoize-one run install scripts?
No. memoize-one does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.