{"_id":"@jscpd/tokenizer@4.2.6","bugs":{"url":"https://github.com/kucherenko/jscpd/issues"},"dist":{"shasum":"5122fa5ec5c8098931ce67f91c62a9bf434367d1","tarball":"http://registry-npm.ywwl.com/@jscpd/tokenizer/download/@jscpd/tokenizer-4.2.6.tgz","fileCount":9,"integrity":"sha512-/eyFjINWLs2mrBTU4H681bs855r5oRyl1O3mZxcd7TpL1JIG85a7pps0RkRPAe9c/2KcjVCc82HbhOz86M0n5g==","signatures":[{"sig":"MEYCIQDgwxI48/y1aPQ10iDKqfu8DUf9BgGH8QhvRs8nw5f80wIhAIHBQHchxuv10oPjE0XlUp1ds6YfTIvWrDfBFQYjmfJm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCiqWkZs1aZmhW2bgOg6wpszgKeXQ2wAolMR53JKlIp4QIhAPEAlSva4Gv1h56uRTw+gSvfAVB/ul+5Pg0Ju4hSImTq"}],"unpackedSize":2530859,"size":704100,"noattachment":false,"key":"/@jscpd/tokenizer/-/@jscpd/tokenizer-4.2.6.tgz"},"main":"dist/index.js","name":"@jscpd/tokenizer","_from":"file:jscpd-tokenizer-4.2.6.tgz","author":{"name":"Andrey Kucherenko","email":"kucherenko.andrey@gmail.com"},"module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./README.md":"./README.md"},"gitHead":"beaae8ee77d5c7f41d2a0c65187887bd0dc87148","license":"MIT","scripts":{"dev":"nodemon","test":"vitest run","build":"tsup-node --dts","cleanup":"rimraf ./dist .turbo","test:dev":"vitest","typecheck":"tsc"},"typings":"dist/index.d.mts","version":"4.2.6","_npmUser":{"name":"apk","email":"kucherenko.andrey@gmail.com"},"homepage":"https://jscpd.dev","_resolved":"/tmp/af7da31b8cb4ca6f2f441cb3e05013e7/jscpd-tokenizer-4.2.6.tgz","_integrity":"sha512-/eyFjINWLs2mrBTU4H681bs855r5oRyl1O3mZxcd7TpL1JIG85a7pps0RkRPAe9c/2KcjVCc82HbhOz86M0n5g==","repository":{"url":"git+https://github.com/kucherenko/jscpd.git","type":"git"},"_npmVersion":"11.16.0","description":"tokenizer of source code for jscpd","directories":{"lib":"src","test":"__tests__"},"maintainers":[{"name":"apk","email":"kucherenko.andrey@gmail.com"}],"_nodeVersion":"24.18.0","dependencies":{"spark-md5":"^3.0.2","@jscpd/core":"4.2.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^4.1.10","nodemon":"^3.1.14","typescript":"^5.5.4","@types/node":"^26.0.1","@jscpd/tsconfig":"5.2.4","@types/spark-md5":"^3.0.5"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tokenizer_4.2.6_1786637650977_0.33169645633403144"},"readme":"# `@jscpd/tokenizer`\n\n> Tokenizer package for [@jscpd](https://github.com/kucherenko/jscpd) — converts source code into a list of tokens for duplicate detection.\n\nSupports **223 programming languages and formats** via a self-contained [reprism](https://github.com/tannerlinsley/reprism)-based grammar engine. Grammars are loaded lazily for fast startup, with O(n) hot paths for high-throughput scanning.\n\nSpecial tokenization modes handle multi-language files:\n\n- **Vue SFC** (`.vue`) — `<template>`, `<script>`, and `<style>` blocks each tokenized by their own language\n- **Svelte** (`.svelte`) — per-block tokenization for HTML, JS, and CSS sections\n- **Astro** (`.astro`) — frontmatter and template blocks tokenized independently\n- **Markdown** (`.md`) — fenced code blocks tokenized by the declared language\n\nThis enables cross-format clone detection: a `<script lang=\"ts\">` block in a `.vue` file can match a plain `.ts` file.\n\n## Installation\n\n```bash\nnpm install @jscpd/tokenizer --save\n```\n\n## Usage\n\n```typescript\nimport { IOptions, ITokensMap } from '@jscpd/core';\nimport { Tokenizer } from '@jscpd/tokenizer';\n\nconst tokenizer = new Tokenizer();\nconst options: IOptions = {};\n\nconst maps: ITokensMap[] = tokenizer.generateMaps('source_id', 'let a = \"11\"', 'javascript', options);\n```\n\n## Supported formats\n\nThe full list of 223 supported formats is available in [FORMATS.md](../../FORMATS.md) at the repository root, or at runtime:\n\n```bash\njscpd --list\n```\n\n\n## License\n\n[MIT](LICENSE) © Andrey Kucherenko\n","publish_time":1786637651123,"_cnpm_publish_time":1786637651123,"dist-tags":{"canary":"3.3.0-alpha.8","latest":"4.2.6","rc":"4.0.0"}}