Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 783 Bytes

README.md

File metadata and controls

25 lines (17 loc) · 783 Bytes

p-memoize-cjs

The upstream https://github.com/sindresorhus/p-memoize only functions if you run native ESM. Right now the toolchain is simply too experimental to update complicated workflows to ESM. Too many tools like ts-node, ts-node-dev, yarn just don't fully support ESM in a non-experimental way.

This library takes the export of p-memoize and just exports it as commonjs so you can import it in any Node project.

I wish this wasn't necessary.

usage

npm install p-memoize-cjs

Import syntax

// just pMemoize
import pMemoize from "p-memoize-cjs";

// other functions
import pMemoize, { pMemoizeClear, pMemoizeDecorator } from "p-memoize-cjs";

CJS

const { pMemoize, pMemoizeClear, pMemoizeDecorator } = "p-memoize-cjs";