@jest/create-cache-key-function
This module creates a function which is used for generating cache keys used by code transformers in Jest.
Last updated a year ago by simenb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @jest/create-cache-key-function 
SYNC missed versions from official npm registry.

jest-create-cache-key-function

This module creates a function which is used for generating cache keys used by code transformers in Jest.

Install

$ npm install --save-dev @jest/create-cache-key-function

API

createCacheKey(files?: Array<string>, values?: Array<String>, length?: number): GetCacheKeyFunction

Returns a function that can be used to generate cache keys based on source code of provided files and provided values.

Parameters

  • files: [Optional] Array of absolute paths to files whose code should be accounted for when generating cache key
  • values: [Optional] Array of string values that should be accounted for when generating cache key
  • length: [Optional] Length of the resulting key. The default is 32, or 16 on Windows.

Note:

The 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.

Usage

Here is some sample usage code while creating a new transformer for Jest

const createCacheKeyFunction =
  require('@jest/create-cache-key-function').default;

const filesToAccountFor = [
  __filename,
  require.resolve('some-package-name/package.json'),
];

const valuesToAccountFor = [process.env.SOME_LOCAL_ENV, 'Some_Other_Value'];

module.exports = {
  process(src, filename, config, options) {},
  getCacheKey: createCacheKeyFunction(filesToAccountFor, valuesToAccountFor),
};

Current Tags

  • 29.7.0                                ...           latest (a year ago)
  • 30.0.0-alpha.6                                ...           next (3 months ago)

73 Versions

  • 30.0.0-alpha.6                                ...           3 months ago
  • 30.0.0-alpha.5                                ...           6 months ago
  • 30.0.0-alpha.4                                ...           6 months ago
  • 30.0.0-alpha.3                                ...           9 months ago
  • 30.0.0-alpha.2                                ...           a year ago
  • 30.0.0-alpha.1                                ...           a year ago
  • 29.7.0                                ...           a year ago
  • 29.6.3                                ...           a year ago
  • 29.6.2                                ...           a year ago
  • 29.6.1                                ...           a year ago
  • 29.6.0                                ...           a year ago
  • 29.5.0                                ...           2 years ago
  • 29.4.3                                ...           2 years ago
  • 29.4.2                                ...           2 years ago
  • 29.4.1                                ...           2 years ago
  • 29.4.0                                ...           2 years ago
  • 29.3.1                                ...           2 years ago
  • 29.2.1                                ...           2 years ago
  • 29.2.0                                ...           2 years ago
  • 29.1.2                                ...           2 years ago
  • 29.1.0                                ...           2 years ago
  • 29.0.3                                ...           2 years ago
  • 29.0.2                                ...           2 years ago
  • 29.0.1                                ...           2 years ago
  • 29.0.0                                ...           2 years ago
  • 29.0.0-alpha.6                                ...           2 years ago
  • 29.0.0-alpha.4                                ...           2 years ago
  • 29.0.0-alpha.3                                ...           2 years ago
  • 29.0.0-alpha.0                                ...           2 years ago
  • 28.1.3                                ...           2 years ago
  • 28.1.1                                ...           2 years ago
  • 28.1.0                                ...           3 years ago
  • 28.0.2                                ...           3 years ago
  • 28.0.1                                ...           3 years ago
  • 28.0.0                                ...           3 years ago
  • 28.0.0-alpha.9                                ...           3 years ago
  • 28.0.0-alpha.8                                ...           3 years ago
  • 28.0.0-alpha.7                                ...           3 years ago
  • 28.0.0-alpha.6                                ...           3 years ago
  • 28.0.0-alpha.5                                ...           3 years ago
  • 28.0.0-alpha.4                                ...           3 years ago
  • 28.0.0-alpha.3                                ...           3 years ago
  • 28.0.0-alpha.2                                ...           3 years ago
  • 28.0.0-alpha.1                                ...           3 years ago
  • 28.0.0-alpha.0                                ...           3 years ago
  • 27.5.1                                ...           3 years ago
  • 27.5.0                                ...           3 years ago
  • 27.4.2                                ...           3 years ago
  • 27.4.1                                ...           3 years ago
  • 27.4.0                                ...           3 years ago
  • 27.3.1                                ...           3 years ago
  • 27.3.0                                ...           3 years ago
  • 27.2.5                                ...           3 years ago
  • 27.2.4                                ...           3 years ago
  • 27.2.3                                ...           3 years ago
  • 27.2.0                                ...           3 years ago
  • 27.1.1                                ...           3 years ago
  • 27.1.0                                ...           3 years ago
  • 27.0.6                                ...           3 years ago
  • 27.0.2                                ...           3 years ago
  • 27.0.1                                ...           3 years ago
  • 27.0.0-next.11                                ...           3 years ago
  • 27.0.0-next.10                                ...           3 years ago
  • 27.0.0-next.9                                ...           4 years ago
  • 27.0.0-next.8                                ...           4 years ago
  • 27.0.0-next.7                                ...           4 years ago
  • 27.0.0-next.6                                ...           4 years ago
  • 27.0.0-next.4                                ...           4 years ago
  • 27.0.0-next.3                                ...           4 years ago
  • 27.0.0-next.1                                ...           4 years ago
  • 27.0.0-next.0                                ...           4 years ago
  • 26.6.2                                ...           4 years ago
  • 26.5.0                                ...           4 years ago
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE