Require extension that allows for caching/precompiling
npm install require-precompiled> Require extension that allows for caching/precompiling
```
$ npm install --save require-precompiled
`js
const installPrecompiler = require('require-precompiled');
const cache = require('my-cache-implementation');
installPrecompiler(filename => {
if (cache.hasEntryFor(filename)) {
return cache.getPrecompiledCode(filename);
}
// fall through to underlying extension chain;
return null;
});
// Any module required from this point on will be checked against the cache.
const foo = require('some-module');
`
#### callback
Type: Function(string: filename)
Return string contents for a cache hit, or null` for a miss.
MIT © James Talmage