cache-require-source
Caches loaded source in module require to speed up next app load
Last updated 6 years ago by bahmutov .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install cache-require-source 
SYNC missed versions from official npm registry.

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.

Use

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.

TODO

  • [ ] Cache only the 3rd party javascript sources
  • [ ] Invalidate cache if dependencies in the package.json change

Small print

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

Current Tags

  • 0.1.0                                ...           latest (6 years ago)

1 Versions

  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |