# @jscpd/core

> core functionality of copy/paste detector for jscpd

Latest version **4.2.5** (published 2026-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jscpd/core
pnpm add @jscpd/core
yarn add @jscpd/core
bun add @jscpd/core
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.2.5 |
| Published | 2026-06-07 |
| First published | 2020-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 89.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6289 |
| Author | Andrey Kucherenko |
| Maintainers | apk |

## Links

- npm: https://www.npmjs.com/package/@jscpd/core
- Repository: https://github.com/kucherenko/jscpd
- Homepage: https://github.com/kucherenko/jscpd#readme
- Issues: https://github.com/kucherenko/jscpd/issues
- npm.io page: https://npm.io/package/@jscpd/core

## Dependencies (1)

- [eventemitter3](https://npm.io/package/eventemitter3.md) ^5.0.1

## Recent versions

- 4.2.5 (latest) — 2026-06-07
- 4.0.0 (rc) — 2024-05-26
- 3.5.10 (next) — 2024-05-26
- 3.3.0-alpha.8 (canary) — 2020-04-29
- 4.2.4 — 2026-05-25
- 4.2.3 — 2026-05-17
- 4.2.2 — 2026-05-15
- 4.2.1 — 2026-05-15
- 4.2.0 — 2026-05-14
- 4.1.1 — 2026-05-12
- 4.1.0 — 2026-05-09
- 4.0.5 — 2026-04-10
- 4.0.4 — 2026-01-30
- 4.0.3 — 2026-01-11
- 4.0.2 — 2026-01-11
- … 17 more at https://npm.io/package/@jscpd/core/versions

## README

# `@jscpd/core`

> core package for detect duplicates, depends only on eventemitter3.

## Installation

```
npm install @jscpd/core --save
```

## Usage

```typescript
import {Tokenizer} from '@jscpd/tokenizer';
import {
    Detector,
    MemoryStore,
    IOptions,
    IClone,
    IStore,
    ITokenizer
} from '@jscpd/core';

const options: IOptions = {
    minLines: 5,
    maxLines: 500,
}

const tokenizer: ITokenizer = new Tokenizer();

// here you can use any store what implement IStore interface
const store: IStore = new MemoryStore();

// list of validators, implemented IValidator interface, validate clones
const validators = [];

const detector = new Detector(tokenizer, store, validators, options);

( async () => {
    const format = 'javascript';
    const code: string = '...string with code...';
    const clones: IClone[] = await detector.detect('source_id', code, format);

    console.log(clones);
})();

```

![ga tracker](https://www.google-analytics.com/collect?v=1&a=257770996&t=pageview&dl=https%3A%2F%2Fgithub.com%2Fkucherenko%2Fjscpd&ul=en-us&de=UTF-8&cid=978224512.1377738459&tid=UA-730549-17&z=887657232 "ga tracker")

## License

[MIT](LICENSE) © Andrey Kucherenko

---
_Source: https://npm.io/package/@jscpd/core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
