{"name":"@jest/create-cache-key-function","version":"30.0.0-alpha.7","repository":{"type":"git","url":"https://github.com/jestjs/jest.git","directory":"packages/jest-create-cache-key-function"},"dependencies":{"@jest/types":"30.0.0-alpha.7"},"devDependencies":{"@types/node":"*","jest-util":"30.0.0-alpha.7"},"engines":{"node":"^16.10.0 || ^18.12.0 || >=20.0.0"},"license":"MIT","main":"./build/index.js","types":"./build/index.d.ts","exports":{".":{"types":"./build/index.d.ts","require":"./build/index.js","import":"./build/index.mjs","default":"./build/index.js"},"./package.json":"./package.json"},"publishConfig":{"access":"public"},"gitHead":"bacb7de30d053cd87181294b0c8a8576632a8b02","_nodeVersion":"20.18.0","_npmVersion":"lerna/3.11.0/node@v20.18.0+arm64 (darwin)","_id":"@jest/create-cache-key-function@30.0.0-alpha.7","dist":{"integrity":"sha512-4I6eC/iVfNqje1yx9s+G9V0xn/cHlAhjLD1n2QedIiwabP0hQynziaRvdrCqAW4Cgiqmg1Lyer0tr/YfHpxpQw==","shasum":"4ce5a21d29da361c3a3851a0ef72d8e3653d6458","tarball":"http://registry-npm.ywwl.com/@jest/create-cache-key-function/download/@jest/create-cache-key-function-30.0.0-alpha.7.tgz","fileCount":6,"unpackedSize":8184,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCy76aqt4XIfyk74WZC8in35TJqPQM3sN4il+V5PMRFjgIhANOVlygnIXErEWqpvKIhwy0+0+I261w5na6Q3Etp3V6j"}],"size":3176,"noattachment":false,"key":"/@jest/create-cache-key-function/-/@jest/create-cache-key-function-30.0.0-alpha.7.tgz"},"_npmUser":{"name":"simenb","email":"sbekkhus91@gmail.com"},"directories":{},"maintainers":[{"name":"aaronabramov","email":"aaron@abramov.io"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"rickhanlonii","email":"rickhanlonii@gmail.com"},{"name":"openjs-operations","email":"operations@openjsf.org"},{"name":"cpojer","email":"christoph.pojer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/create-cache-key-function_30.0.0-alpha.7_1738225710399_0.07702521639312643"},"_hasShrinkwrap":false,"readme":"# jest-create-cache-key-function\n\nThis module creates a function which is used for generating cache keys used by code transformers in Jest.\n\n## Install\n\n```sh\n$ npm install --save-dev @jest/create-cache-key-function\n```\n\n## API\n\n### `createCacheKey(files?: Array<string>, values?: Array<String>, length?: number): GetCacheKeyFunction`\n\nReturns a function that can be used to generate cache keys based on source code of provided files and provided values.\n\n#### Parameters\n\n- `files`: [Optional] Array of absolute paths to files whose code should be accounted for when generating cache key\n- `values`: [Optional] Array of string values that should be accounted for when generating cache key\n- `length`: [Optional] Length of the resulting key. The default is `32`, or `16` on Windows.\n\n**Note:**\n\nThe source code for your test is already taken into account when generating the cache key. The `files` array should be used to provide files that are not directly related to your code such as external configuration files.\n\n## Usage\n\nHere is some sample usage code while creating a new transformer for Jest\n\n```javascript\nconst createCacheKeyFunction =\n  require('@jest/create-cache-key-function').default;\n\nconst filesToAccountFor = [\n  __filename,\n  require.resolve('some-package-name/package.json'),\n];\n\nconst valuesToAccountFor = [process.env.SOME_LOCAL_ENV, 'Some_Other_Value'];\n\nmodule.exports = {\n  process(src, filename, config, options) {},\n  getCacheKey: createCacheKeyFunction(filesToAccountFor, valuesToAccountFor),\n};\n```\n","publish_time":1738225710609,"_cnpm_publish_time":1738225710609,"dist-tags":{"latest":"30.5.1","next":"30.0.0-rc.1"}}