</>PackageGraphPackageGraph

memoize-one

npmv6.0.0TypeScript

A 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.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

35 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

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 called
Example truncated — see the full README.

memoize-one vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
memoize-onethis page32.7M3MIT4 years ago
define-lazy-prop01MIT1 day ago
file-entry-cache134.5M1MIT1 day ago
reusify91M1MIT1 day ago
rfdc46.8M3MIT1 day ago
make-fetch-happen22.8M1ISC1 day ago

Dependencies

Declared by memoize-one v6.0.0. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (36)

@size-limit/preset-small-lib ^5.0.4@types/benchmark ^2.1.1@types/jest ^27.0.2@types/lodash.isequal ^4.5.5@types/lodash.memoize ^4.1.6@types/node ^16.10.1@typescript-eslint/eslint-plugin ^4.31.2@typescript-eslint/parser ^4.31.2benchmark ^2.1.4cross-env ^7.0.3eslint 7.32.0eslint-config-prettier ^8.3.0eslint-plugin-jest ^24.4.2eslint-plugin-prettier ^4.0.0expect-type ^0.12.0fast-memoize ^2.5.2jest ^27.2.2lodash.isequal ^4.5.0lodash.memoize ^4.1.2markdown-table ^3.0.1mem ^9.0.1memoizee ^0.4.15moize ^6.1.0nanocolors ^0.2.9ora ^6.0.1prettier 2.4.1rimraf 3.0.2rollup ^2.57.0rollup-plugin-replace ^2.2.0rollup-plugin-terser ^7.0.2rollup-plugin-typescript ^1.0.1size-limit ^5.0.4ts-jest ^27.0.5ts-node ^10.2.1tslib ^2.3.1typescript ^4.4.3

Used by

Popular packages that depend on memoize-one.

Relationship graph

Dependencies (left) and dependents (right) of memoize-one.

reselectreact-nativereact-native-webmemoize-one
memoize-one dependencies dependents

Frequently installed together

Release history

No releases in the last two years, typically about 2 days apart.

Recent versions of memoize-one
VersionPublishedSizeLicense
6.0.0latest4 years ago35 KBMIT
6.0.0-beta.14 years ago32 KBMIT
5.2.15 years ago21 KBMIT
5.2.05 years ago22 KBMIT
5.1.17 years ago18 KBMIT
5.1.07 years ago18 KBMIT
5.1.0-beta.67 years ago18 KBMIT
5.1.0-beta.57 years ago18 KBMIT
5.1.0-beta.47 years ago18 KBMIT
5.1.0-beta.37 years ago19 KBMIT
5.1.0-beta.27 years ago19 KBMIT
5.1.0-beta.17 years ago18 KBMIT
5.0.57 years ago17 KBMIT
5.0.47 years ago17 KBMIT
5.0.37 years ago17 KBMIT

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

Keywords

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.