https://github.com/brentlintner/synt
Find similar functions and classes in your JavaScript/TypeScript code
https://github.com/brentlintner/synt
duplicate javascript nodejs similarity static-analysis typescript
Last synced: 5 months ago
JSON representation
Find similar functions and classes in your JavaScript/TypeScript code
- Host: GitHub
- URL: https://github.com/brentlintner/synt
- Owner: brentlintner
- License: mpl-2.0
- Created: 2014-07-24T14:37:12.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-10-23T21:36:37.000Z (12 months ago)
- Last Synced: 2025-05-08T13:51:25.052Z (5 months ago)
- Topics: duplicate, javascript, nodejs, similarity, static-analysis, typescript
- Language: TypeScript
- Homepage: https://npmjs.org/synt
- Size: 480 KB
- Stars: 182
- Watchers: 4
- Forks: 5
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# synt [](https://circleci.com/gh/brentlintner/synt) [](https://ci.appveyor.com/project/brentlintner/synt/branch/master) [](https://badge.fury.io/js/synt)
Find similar functions and classes in your JavaScript/TypeScript code.
## Supported Languages
* JavaScript ([ES3-ES15](https://github.com/eslint/espree?tab=readme-ov-file#options))
* TypeScript ([5.x](https://github.com/microsoft/TypeScript/tree/v5.3.3))## System Requirements
* [NodeJS](http://nodejs.org)
## Installation & Usage
```sh
npm i synt
```### CLI
*install*
```sh
npm i -g synt
```*help*
```sh
synt -h
```*example*
```sh
git clone https://github.com/brentlintner/synt.git
cd synt
synt analyze src
```### Library
*example*
```javascript
const synt = require("synt")const files = [ "a.js", "b.ts" ]
const { js, ts } = synt.compare(files, {
similarity: 80,
ngram: 1,
minLength: 20,
sourceType: "module",
ecmaVersion: 6
})synt.print(js)
synt.print(ts)
```## Licensing
This project is licensed under the [MPL-2.0](LICENSE) license.
Any contributions made to this project are made under the current license.
## Contributing
Any contributions are welcome and appreciated!
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more info.
## Versioning
This project ascribes to [semantic versioning](http://semver.org).
## Name
`synt` is short for [synteny](http://en.wikipedia.org/wiki/Synteny), and is
an (attempted) play on comparing code evolution to genetic (evolution).