Have ideas to improve npm?Join in the discussion! »

    @jscpd/finder
    TypeScript icon, indicating that this package has built-in type declarations

    3.3.26 • Public • Published

    @jscpd/finder

    core package for detect duplicates, depends only on eventemmiter3.

    Installation

    npm install @jscpd/finder --save
    

    Usage

    import {Tokenizer} from '@jscpd/tokenizer';
    import {
        MemoryStore,
        IOptions,
        IClone,
        IStore,
        ITokenizer
    } from '@jscpd/core';
    import {EntryWithContent, getFilesToDetect, InFilesDetector} from '@jscpd/finder';
    
    const options: IOptions = {
        minLines: 5,
        maxLines: 500,
        path: ['list of folders and files to analyse for clones']
    }
    
    const tokenizer: ITokenizer = new Tokenizer();
    // here you can use any store what implement IStore interface
    const store: IStore = new MemoryStore();
    const statistic = new Statistic(options);
    
    const files: EntryWithContent[] = getFilesToDetect(options);
    
    const detector = new InFilesDetector(tokenizer, store, statistic, options);
    
    ( async () => {
      const clones: IClone[] = await detector.detect(files);
    })();

    ga tracker

    License

    MIT © Andrey Kucherenko

    Keywords

    none

    Install

    npm i @jscpd/finder

    DownloadsWeekly Downloads

    31,048

    Version

    3.3.26

    License

    MIT

    Unpacked Size

    68 kB

    Total Files

    88

    Last publish

    Collaborators

    • avatar