7.1.0 • Published 2 years ago

p-memoize-cjs v7.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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";