Socket
Socket
Sign inDemoInstall

@jscpd/finder

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jscpd/finder

detector of copy/paste in files


Version published
Weekly downloads
68K
decreased by-8.14%
Maintainers
1
Weekly downloads
 
Created
Source

@jscpd/finder

core package for detect duplicates, depends only on eventemitter3.

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

FAQs

Package last updated on 17 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc