@jscpd/finder
detector of copy/paste in files
Last updated a year ago by apk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @jscpd/finder 
SYNC missed versions from official npm registry.

@jscpd/finder

File discovery and in-files detection package for jscpd — walks the filesystem to collect source files, runs the duplicate detector across them, and provides built-in reporters, subscribers, validators, and hooks.

Key exports:

  • getFilesToDetect(options) — resolves the file list from paths, globs, and ignore patterns
  • InFilesDetector — orchestrates tokenization, store lookup, and clone collection across a file list
  • Reporters — console, consoleFull, json, xml, csv, markdown, xcode, ai, silent, threshold
  • Subscribers — verbose, progress
  • Validators — skipLocal
  • Hooks — blamer, fragment

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();
// any store implementing IStore works here
const store: IStore = new MemoryStore();

const files: EntryWithContent[] = getFilesToDetect(options);
const detector = new InFilesDetector(tokenizer, store, options);

(async () => {
  const clones: IClone[] = await detector.detect(files);
})();

License

MIT © Andrey Kucherenko

Current Tags

  • 3.3.0-alpha.8                                ...           canary (7 years ago)
  • 4.3.0                                ...           latest (3 months ago)
  • 4.0.0                                ...           rc (3 years ago)

47 Versions

  • 4.3.0                                ...           3 months ago
  • 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.5                                ...           4 years ago
  • 3.5.4                                ...           4 years ago
  • 3.5.1                                ...           4 years ago
  • 3.5.0                                ...           4 years ago
  • 3.4.5                                ...           5 years ago
  • 3.4.1                                ...           5 years ago
  • 3.3.26                                ...           6 years ago
  • 3.3.25                                ...           6 years ago
  • 3.3.24                                ...           6 years ago
  • 3.3.23                                ...           6 years ago
  • 3.3.21                                ...           6 years ago
  • 3.3.20                                ...           6 years ago
  • 3.3.19                                ...           6 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.3                                ...           6 years ago
  • 3.3.2                                ...           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.7                                ...           6 years ago
  • 3.3.0-rc.6                                ...           7 years ago
  • 3.3.0-rc.5                                ...           7 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 128
Today 0
This Week 1
This Month 90
Last Day 0
Last Week 85
Last Month 4
Dependencies (10)
Dev Dependencies (10)
Dependents (2)

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