@jscpd/core
core functionality of copy/paste detector for jscpd
Last updated 2 years 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 (5 years ago)
  • 4.0.1                                ...           latest (6 months ago)
  • 3.5.10                                ...           next (6 months ago)
  • 4.0.0                                ...           rc (6 months ago)

20 Versions

  • 4.0.1                                ...           6 months ago
  • 4.0.0                                ...           6 months ago
  • 3.5.10                                ...           6 months ago
  • 3.5.4                                ...           2 years ago
  • 3.5.0                                ...           2 years ago
  • 3.4.5                                ...           3 years ago
  • 3.4.1                                ...           3 years ago
  • 3.3.17                                ...           4 years ago
  • 3.3.14                                ...           4 years ago
  • 3.3.13                                ...           4 years ago
  • 3.3.11                                ...           4 years ago
  • 3.3.9                                ...           4 years ago
  • 3.3.8                                ...           4 years ago
  • 3.3.1                                ...           4 years ago
  • 3.3.0-rc.10                                ...           4 years ago
  • 3.3.0-rc.8                                ...           4 years ago
  • 3.3.0-rc.4                                ...           5 years ago
  • 3.3.0-rc.3                                ...           5 years ago
  • 3.3.0-alpha.8                                ...           5 years ago
  • 3.3.0-alpha.2                                ...           5 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None

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