The extendable JavaScript mutation testing framework
npm install @stryker-mutator/core




Please follow the quickstart on the website.
For small js projects, you can try the following command:
```
npm install --save-dev @stryker-mutator/coreOnly for small projects:
npx stryker run
It will run stryker with default values:
* Uses npm test as your test commandlib
* Searches for files to mutate in the and src directories
`sh`
$ npx stryker
See usage on stryker-mutator.io
See our website for the list of currently supported mutators.
See configuration on stryker-mutator.io.
Stryker can also be used programmatically from nodejs. It exports 2 classes for you to use: Stryker and StrykerCli.
`ts`
import { Stryker, StrykerCli } from '@stryker-mutator/core';
Both classes can be used to run Stryker. The main difference is that Stryker is a slightly more low-level approach, while StrykerCli is the straight up CLI api.
In this example you can see how to use both.
`tsprocess.exit
async function main() {
// Runs Stryker as if it was called directly from the cli. Not even returns a promise, it assumes to be allowed to call .
new StrykerCli(process.argv / RAW argv array / ).run();
// Runs Stryker, will not assume to be allowed to exit the process.
const stryker = new Stryker({ concurrency: 4 } / Partial Stryker options object / );
const mutantResults = await stryker.runMutationTest();
// mutantResults or rejected with an error.
}
``
Stryker is written in TypeScript, so it is recommended to use Typescript as well to get the best developer experience.