{"name":"v8-compile-cache-lib","version":"3.0.1","description":"Require hook for automatic V8 compile cache persistence","main":"v8-compile-cache.js","scripts":{"bench":"bench/run.sh","eslint":"eslint --max-warnings=0 .","tap":"tap test/*-test.js","test":"npm run tap","posttest":"npm run eslint"},"author":{"name":"Andrew Bradley","email":"cspotcode@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/cspotcode/v8-compile-cache-lib.git"},"license":"MIT","dependencies":{},"devDependencies":{"babel-core":"6.26.3","eslint":"^7.12.1","flow-parser":"0.136.0","rimraf":"^2.5.4","rxjs":"6.6.3","semver":"^5.3.0","tap":"^9.0.0","temp":"^0.8.3","yarn":"1.22.10"},"bugs":{"url":"https://github.com/cspotcode/v8-compile-cache-lib/issues"},"homepage":"https://github.com/cspotcode/v8-compile-cache-lib#readme","_id":"v8-compile-cache-lib@3.0.1","_nodeVersion":"17.3.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==","shasum":"6336e8d71965cb3d35a1bbb7868445a7c05264bf","tarball":"http://registry-npm.ywwl.com/v8-compile-cache-lib/download/v8-compile-cache-lib-3.0.1.tgz","fileCount":6,"unpackedSize":18165,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5vL2qkFNnHQNlG63To4Rm+qqwsAxHIgbyRyhnMCywRAIgVppYcUkV9GInw7hL+Uvkllv/mIJrY0aq44jSJQTcBOk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWhXrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZgw/6AqWBEKR0E0e4fgzNOpBN0/p7DsiGcqccveabLD8B/hDr0oRm\r\nNuchEvTpyq5KYyE70K8O71pkmw00dyowbxHzecBGhNOpnqY3YVXYVwsNiJiD\r\n2dgjhOaUjhi4svBOLscrp0UMuqn1hRHTZNM9ICqBqU0X73Ey5hb2QstHVOsn\r\nw8jsczmFxiTvjaEShEcs6eikDdtmrOD0F4Mjbp1l83Osyf+iW4M2Yp3bmGt4\r\nPu+YMdqXxY1JdL/xjQcaqwGAHU9AfT9RaNFTUhgkfyufAiyOzSlMufD1whOO\r\nQ/daFoRglz4G3hambypEE9oYGVwi3KBx68xeyg62eAwNNQjkXqFKLcPKJAMJ\r\nGyDcMI4q7NApziLl/TR8kBis1Aaay8ILs/VipWs/Tbr5fb3zraDtXyQVmAuh\r\n1YQ5xZCsJstwwlyAfltbrqnFWcf2PcGyCyie3JBvrJoV4UecMqdRJcIaycmT\r\nHx0yZm/lZmLFtbzdY1tygMhmkMtFpJGrsBYawEmao9AiYZDZw7EcmtKBjVga\r\nUgV6bSXnYPH+L6wI3zaWebbKjJMimL8Z/ZVWonAY1uGn+H/4TsQ/UIaH/Nqp\r\n7+suO+PqqGyBqkTlgpWeY3QlY5Cm+kBY4UWo+3jxus2IyVoVPwRpXr7Oq1IX\r\ng6t3uyD2KQgQ63hR0oozq6svEiBKeoDztjw=\r\n=s6xY\r\n-----END PGP SIGNATURE-----\r\n","size":6391,"noattachment":false,"key":"/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz"},"_npmUser":{"name":"cspotcode","email":"cspotcode@gmail.com"},"directories":{},"maintainers":[{"name":"cspotcode","email":"cspotcode@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/v8-compile-cache-lib_3.0.1_1650071019009_0.025645322864183306"},"_hasShrinkwrap":false,"readme":"# v8-compile-cache-lib\n\n> Fork of [`v8-compile-cache`](https://www.npmjs.com/package/v8-compile-cache) exposed as an API for programmatic usage in other libraries and tools.\n\n---\n\n[![Build status](https://img.shields.io/github/workflow/status/cspotcode/v8-compile-cache-lib/Continuous%20Integration)](https://github.com/cspotcode/v8-compile-cache-lib/actions?query=workflow%3A%22Continuous+Integration%22)\n\n`v8-compile-cache-lib` attaches a `require` hook to use [V8's code cache](https://v8project.blogspot.com/2015/07/code-caching.html) to speed up instantiation time. The \"code cache\" is the work of parsing and compiling done by V8.\n\nThe ability to tap into V8 to produce/consume this cache was introduced in [Node v5.7.0](https://nodejs.org/en/blog/release/v5.7.0/).\n\n## Usage\n\n1. Add the dependency:\n\n  ```sh\n  $ npm install --save v8-compile-cache-lib\n  ```\n\n2. Then, in your entry module add:\n\n  ```js\n  require('v8-compile-cache-lib').install();\n  ```\n\n**`.install()` in Node <5.7.0 is a noop – but you need at least Node 4.0.0 to support the ES2015 syntax used by `v8-compile-cache-lib`.**\n\n## Options\n\nSet the environment variable `DISABLE_V8_COMPILE_CACHE=1` to disable the cache.\n\nCache directory is defined by environment variable `V8_COMPILE_CACHE_CACHE_DIR` or defaults to `<os.tmpdir()>/v8-compile-cache-<V8_VERSION>`.\n\n## Internals\n\nCache files are suffixed `.BLOB` and `.MAP` corresponding to the entry module that required `v8-compile-cache-lib`. The cache is _entry module specific_ because it is faster to load the entire code cache into memory at once, than it is to read it from disk on a file-by-file basis.\n\n## Benchmarks\n\nSee https://github.com/cspotcode/v8-compile-cache-lib/tree/master/bench.\n\n**Load Times:**\n\n| Module           | Without Cache | With Cache |\n| ---------------- | -------------:| ----------:|\n| `babel-core`     | `218ms`       | `185ms`    |\n| `yarn`           | `153ms`       | `113ms`    |\n| `yarn` (bundled) | `228ms`       | `105ms`    |\n\n_^ Includes the overhead of loading the cache itself._\n\n## Acknowledgements\n\n* The original [`v8-compile-cache`](https://github.com/zertosh/v8-compile-cache) from which this library is forked.\n* `FileSystemBlobStore` and `NativeCompileCache` are based on Atom's implementation of their v8 compile cache: \n  - https://github.com/atom/atom/blob/b0d7a8a/src/file-system-blob-store.js\n  - https://github.com/atom/atom/blob/b0d7a8a/src/native-compile-cache.js\n* `mkdirpSync` is based on:\n  - https://github.com/substack/node-mkdirp/blob/f2003bb/index.js#L55-L98\n","publish_time":1650071019155,"_cnpm_publish_time":1650071019155,"dist-tags":{"latest":"3.0.1"}}