lodash-magic-cache
v0.2.1
Published
Caches lodash commonjs modules
Downloads
3
Readme
lodash-magic-cache
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.