{"_id":"require-precompiled","_rev":"197505","name":"require-precompiled","description":"Require extension that allows for caching/precompiling","dist-tags":{"latest":"0.1.0"},"maintainers":[{"name":"jamestalmage","email":"james@talmage.io"}],"time":{"modified":"2021-06-03T12:30:00.000Z","created":"2015-12-16T04:02:45.261Z","0.1.0":"2015-12-16T04:02:45.261Z"},"users":{},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"repository":{"type":"git","url":"git+https://github.com/jamestalmage/require-precompiled.git"},"versions":{"0.1.0":{"name":"require-precompiled","version":"0.1.0","description":"Require extension that allows for caching/precompiling","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/require-precompiled.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc --reporter=lcov --reporter=text ava"},"files":["index.js"],"keywords":["require","extension","cache","precompile"],"dependencies":{},"devDependencies":{"ava":"^0.8.0","coveralls":"^2.11.6","fake-module-system":"^0.3.0","nyc":"^5.0.0","xo":"^0.12.0"},"xo":{"ignores":["test.js"]},"gitHead":"dcfe0f2c48131a16447c2e45c5bda396b6cb5eca","bugs":{"url":"https://github.com/jamestalmage/require-precompiled/issues"},"homepage":"https://github.com/jamestalmage/require-precompiled#readme","_id":"require-precompiled@0.1.0","_shasum":"5a1b52eb70ebed43eb982e974c85ab59571e56fa","_from":".","_npmVersion":"3.5.2","_nodeVersion":"5.2.0","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"5a1b52eb70ebed43eb982e974c85ab59571e56fa","size":1845,"noattachment":false,"key":"/require-precompiled/-/require-precompiled-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/require-precompiled/download/require-precompiled-0.1.0.tgz"},"maintainers":[{"name":"jamestalmage","email":"james@talmage.io"}],"directories":{},"publish_time":1450238565261,"_cnpm_publish_time":1450238565261,"_hasShrinkwrap":false}},"readme":"# require-precompiled [![Build Status](https://travis-ci.org/jamestalmage/require-precompiled.svg?branch=master)](https://travis-ci.org/jamestalmage/require-precompiled) [![Coverage Status](https://coveralls.io/repos/jamestalmage/require-precompiled/badge.svg?branch=master&service=github)](https://coveralls.io/github/jamestalmage/require-precompiled?branch=master)\n\n> Require extension that allows for caching/precompiling \n\n\n## Install\n\n```\n$ npm install --save require-precompiled\n```\n\n\n## Usage\n\n```js\nconst installPrecompiler = require('require-precompiled');\nconst cache = require('my-cache-implementation');\n\ninstallPrecompiler(filename => {\n  if (cache.hasEntryFor(filename)) {\n    return cache.getPrecompiledCode(filename);\n  }\n  // fall through to underlying extension chain;\n  return null;\n});\n\n// Any module required from this point on will be checked against the cache.\nconst foo = require('some-module');\n```\n\n\n## API\n\n### requirePrecompiled(callback)\n\n#### callback\n\nType: `Function(string: filename)`\n\nReturn `string` contents for a cache hit, or `null` for a miss.\n\n\n## License\n\nMIT © [James Talmage](http://github.com/jamestalmage)\n","_attachments":{},"homepage":"https://github.com/jamestalmage/require-precompiled#readme","bugs":{"url":"https://github.com/jamestalmage/require-precompiled/issues"},"license":"MIT"}