{"_id":"@akepinski/v8-compile-cache","_rev":"1-bf85715a99957c1f838dbd4c9bed9e61","name":"@akepinski/v8-compile-cache","dist-tags":{"latest":"2.0.3"},"versions":{"2.0.3":{"name":"@akepinski/v8-compile-cache","version":"2.0.3","description":"Require hook for automatic V8 compile cache persistence","main":"v8-compile-cache.js","scripts":{"bench":"bench/run.sh","lint":"eslint --max-warnings=0 .","test":"tap test/*-test.js","posttest":"npm run lint"},"author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/zertosh/v8-compile-cache.git"},"license":"MIT","dependencies":{},"devDependencies":{"@babel/core":"^7.5.5","eslint":"^3.15.0","flow-parser":"0.38.0","rimraf":"^2.5.4","rxjs":"5.2.0","semver":"^5.3.0","tap":"^10.1.1","temp":"^0.8.3","yarn":"0.20.3"},"gitHead":"f97747d900133abe50dcad69715a5245ff38dc66","bugs":{"url":"https://github.com/zertosh/v8-compile-cache/issues"},"homepage":"https://github.com/zertosh/v8-compile-cache#readme","_id":"@akepinski/v8-compile-cache@2.0.3","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-kxlydH8UQwHxysMPjc10I2oGinwuM34LZlEEqVC0Gqz7pc5iwqphdEi5UToH/vLBvlJrE/vSLFzMv8zF6H3kLg==","shasum":"044ad3dfbe005651c9fbbae22d0c03b661643338","tarball":"https://registry.npmjs.org/@akepinski/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz","fileCount":5,"unpackedSize":15886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQc+dCRA9TVsSAnZWagAARHUP/3uxbDrHr0m03HnSVEvK\nXinQgeaJVtjFSEywXseM3b6ZTeieJFd1630uglEEgBUtHmz8ALnVy22UNMY+\npCxJppElO/HfIByeZuG0x4p4O4cMVfI5DDSqCR4EU8kcVK0/qcs/rtye89VY\nwCXuU9ZHH7KMvXBDTOcLvIh/kY0GiFutCbnGawcLHZqDxx0LTc4/xUlD5tOs\nuUkc1igqRraxuWTlLoRipsztkTuZjS0xffzCiqG2vUrJESdVOl5rqtl94lkX\nDxGEnjnb5Jp5KTQM56FPrnFogVNZJfMxzvNETDkP7HYog6L2nMc6t7Z1JscN\nkmwPWAA2sOY28FczrSmLniVzjFcR6a8RJlclYFfUjSkMQbM8F5bst7pbaQRQ\nPnDWfaVr6sni/3D59q5aF+dCgFKcF+XaYbMisesm4/eXr2BbV8hK6cwkoH0h\n+RWN76bXNwLCov9QS59L+1YnYoqx918TBYPMbIQ38EQGF4LuCsu/QOEfdocr\nBaXt/kEP7yaiCD9Gm3GOLJN2ni59xlZ1wxZQUzmEMOMg0UOF7kHrcGIMGg+v\nOtMrqM8k4yDfEVY8Iq6xVxt1TTu4wXh4g8sm5yWfNfk7hmmT3AtN5Gm1RHF6\nWgMl9qyp5LBSJfUyIe/CNcfOwEspguEnXolAzK/hR0oy2hHM3AjnXsMkLGhA\n4ic3\r\n=0aOt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBNFzeki7JFPi2uKByDcUgV/RRTbsu/IjTXPLkEbjz2AIgGN8vf47S1E3u8mQ46CEalWDu8pdOvlP6kPu35hqjViM="}]},"maintainers":[{"name":"akepinski","email":"xxczaki@pm.me"}],"_npmUser":{"name":"akepinski","email":"xxczaki@pm.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/v8-compile-cache_2.0.3_1564594076952_0.25719444068515473"},"_hasShrinkwrap":false}},"time":{"created":"2019-07-31T17:27:56.742Z","2.0.3":"2019-07-31T17:27:57.130Z","modified":"2022-04-04T12:29:07.392Z"},"maintainers":[{"name":"akepinski","email":"xxczaki@pm.me"}],"description":"Require hook for automatic V8 compile cache persistence","homepage":"https://github.com/zertosh/v8-compile-cache#readme","repository":{"type":"git","url":"git+https://github.com/zertosh/v8-compile-cache.git"},"author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"bugs":{"url":"https://github.com/zertosh/v8-compile-cache/issues"},"license":"MIT","readme":"# v8-compile-cache\n\n[![Build Status](https://travis-ci.org/zertosh/v8-compile-cache.svg?branch=master)](https://travis-ci.org/zertosh/v8-compile-cache)\n\n`v8-compile-cache` 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\n  ```\n\n2. Then, in your entry module add:\n\n  ```js\n  require('v8-compile-cache');\n  ```\n\n**Requiring `v8-compile-cache` 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`.**\n\n## Options\n\nSet the environment variable `DISABLE_V8_COMPILE_CACHE=1` to disable the cache.\n\n## Internals\n\nThe caches are stored in `$TMP/v8-compile-cache/V8_VERSION`, where there are `.BLOB` and `.MAP` files corresponding to the entry module that required `v8-compile-cache`. 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/zertosh/v8-compile-cache/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* `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","readmeFilename":"README.md"}