Getting Started
Introduction
Welcome to jscpd documentation.
Welcome to jscpd, a powerful copy/paste detector for programming source code that supports 150+ languages and formats.
What is jscpd?
jscpd is a tool that helps you find duplicated blocks in programming source code. Copy/paste is a common source of technical debt in software projects, and jscpd helps you identify and eliminate these duplications.
The tool implements the Rabin-Karp algorithm for efficient searching of duplications across large codebases.
Key Features
150+ Languages
Supports JavaScript, TypeScript, Python, Java, C++, Go, Rust, and many more programming languages and document formats.
Fast Detection
Uses the efficient Rabin-Karp algorithm for quick duplicate detection even in large codebases.
CLI & API
Use via command line or integrate programmatically into your Node.js applications.
Multiple Reporters
Generate reports in HTML, JSON, XML, Markdown, and more for easy integration with CI/CD.
Packages
jscpd is modular and consists of several packages:
| Package | Description |
|---|---|
| jscpd | Main package with CLI and detection API |
| jscpd-server | Standalone server application |
| @jscpd/core | Core detection algorithm |
| @jscpd/finder | File duplication detector |
| @jscpd/tokenizer | Source code tokenizer |
| @jscpd/html-reporter | HTML report generator |
| @jscpd/badge-reporter | Badge generator for README files |
| @jscpd/leveldb-store | LevelDB store for big repositories |
Quick Example
# Install globally
npm install -g jscpd
# Run on your source code
jscpd /path/to/source
# Or use npx without installing
npx jscpd /path/to/source
Ready to get started? Head to the Installation guide.