$ cnpm install cache-require-source
Caches loaded source in module require to speed up next app load
This is a partial solution to slow Node application startup. See Node’s require
is dog slow for details.
npm install --save cache-require-source
Load the module first in your application file
// index.js
require('cache-require-source');
...
The first time the app loads a cache of 3rd party file sources will be saved in a local .
file. Every application startup after that will reuse this cache to avoid loading multiple files. Works well with cache-require-paths.
Author: Gleb Bahmutov © 2015
License: MIT - do anything with the code, but don't blame me if it does not work.
Spread the word: tweet, star on github, etc.
Support: if you find any problems with this module, email / tweet / open issue on Github
Copyright 2014 - 2016 © taobao.org |