0.2.1 • Published 5 years ago

lodash-magic-cache v0.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

lodash-magic-cache

Greenkeeper badge npmjs downloads CircleCI Coverage Status Climate

Magic cache 🍒 caches your lodash 📦 at Node.js for you.

Meant to be used with lodash-magic-import

How to use

> npm i --save lodash lodash-magic-cache

with

const _ = require('lodash-magic-cache').lodash([
  'map', 'forEach', 'keys'
]);

or

const _cache =  require('lodash-magic-cache').lodashFP([
  'map', 'forEach', 'keys'
]);

It's quite simple.

When to use

Well, require'ing whole lodash takes a lot of time. Even require'ing the same modules over and over is a hassle.

It's much faster on Node.js with a dedicated _.memoize powered cache.

lodash-magic-cache makes sense when you're targeting plain node.js, or using babel with lodash-magic-import.

It's completely pointless with a bundler like webpack or rollup, because they've already using similar caching technique.

Q&A

Feel free to ask some questions via Discord.

License

Licensed under MIT license, of course.