@jscpd/core
core functionality of copy/paste detector for jscpd
Last updated 7 months ago by apk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @jscpd/core 
SYNC missed versions from official npm registry.

@jscpd/core

core package for detect duplicates, depends only on eventemitter3.

Installation

npm install @jscpd/core --save

Usage

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

License

MIT © Andrey Kucherenko

Current Tags

  • 3.3.0-alpha.8                                ...           canary (7 years ago)
  • 4.2.5                                ...           latest (6 months ago)
  • 3.5.10                                ...           next (3 years ago)
  • 4.0.0                                ...           rc (3 years ago)

32 Versions

  • 4.2.5                                ...           6 months ago
  • 4.2.4                                ...           6 months ago
  • 4.2.3                                ...           6 months ago
  • 4.2.2                                ...           6 months ago
  • 4.2.1                                ...           6 months ago
  • 4.2.0                                ...           6 months ago
  • 4.1.1                                ...           7 months ago
  • 4.1.0                                ...           7 months ago
  • 4.0.5                                ...           8 months ago
  • 4.0.4                                ...           10 months ago
  • 4.0.3                                ...           a year ago
  • 4.0.2                                ...           a year ago
  • 4.0.1                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 3.5.10                                ...           3 years ago
  • 3.5.4                                ...           4 years ago
  • 3.5.0                                ...           4 years ago
  • 3.4.5                                ...           5 years ago
  • 3.4.1                                ...           5 years ago
  • 3.3.17                                ...           6 years ago
  • 3.3.14                                ...           6 years ago
  • 3.3.13                                ...           6 years ago
  • 3.3.11                                ...           6 years ago
  • 3.3.9                                ...           6 years ago
  • 3.3.8                                ...           6 years ago
  • 3.3.1                                ...           6 years ago
  • 3.3.0-rc.10                                ...           6 years ago
  • 3.3.0-rc.8                                ...           6 years ago
  • 3.3.0-rc.4                                ...           7 years ago
  • 3.3.0-rc.3                                ...           7 years ago
  • 3.3.0-alpha.8                                ...           7 years ago
  • 3.3.0-alpha.2                                ...           7 years ago
Maintainers (1)
Downloads
Total 78
Today 0
This Week 1
This Month 45
Last Day 0
Last Week 38
Last Month 21
Dependencies (1)
Dev Dependencies (5)

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