{"id":13702466,"url":"https://github.com/hcodes/yaspeller","last_synced_at":"2025-05-05T04:31:02.711Z","repository":{"id":23056664,"uuid":"26409952","full_name":"hcodes/yaspeller","owner":"hcodes","description":"🔍 Search tool typos in the text, files and websites","archived":true,"fork":false,"pushed_at":"2024-04-24T07:46:11.000Z","size":1334,"stargazers_count":641,"open_issues_count":7,"forks_count":39,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-05-17T18:03:18.787Z","etag":null,"topics":["cli","javascript","nodejs","spellcheck","speller","spelling-checker","yandex"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/yaspeller","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hcodes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-09T21:31:46.000Z","updated_at":"2024-06-18T12:33:55.108Z","dependencies_parsed_at":"2024-04-24T09:00:15.269Z","dependency_job_id":null,"html_url":"https://github.com/hcodes/yaspeller","commit_stats":{"total_commits":368,"total_committers":16,"mean_commits":23.0,"dds":0.4375,"last_synced_commit":"f1f199fc0b0f7c190418befb0965b904010fa97b"},"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcodes%2Fyaspeller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcodes%2Fyaspeller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcodes%2Fyaspeller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcodes%2Fyaspeller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hcodes","download_url":"https://codeload.github.com/hcodes/yaspeller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252439513,"owners_count":21748019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","javascript","nodejs","spellcheck","speller","spelling-checker","yandex"],"created_at":"2024-08-02T21:00:36.175Z","updated_at":"2025-05-05T04:31:02.232Z","avatar_url":"https://github.com/hcodes.png","language":"JavaScript","funding_links":[],"categories":["Documentation and Presentation","JavaScript"],"sub_categories":[],"readme":"yaspeller\n=========\n[![NPM version](https://img.shields.io/npm/v/yaspeller.svg)](https://www.npmjs.com/package/yaspeller)\n[![NPM Downloads](https://img.shields.io/npm/dm/yaspeller.svg?style=flat)](https://www.npmjs.org/package/yaspeller)\n[![Coverage Status](https://img.shields.io/coveralls/hcodes/yaspeller.svg)](https://coveralls.io/r/hcodes/yaspeller)\n[![install size](https://packagephobia.com/badge?p=yaspeller)](https://packagephobia.com/result?p=yaspeller)\n\n\n**This project is closed, use [CSpell](https://cspell.org/) or another alternative. [Example of using CSpell](https://habr.com/ru/articles/809889/)**\n\n\u003cimg align=\"right\" width=\"200\" src=\"https://raw.githubusercontent.com/hcodes/yaspeller/master/images/logo.png\" /\u003e\n\n\nThis README is also available [in Russian](./README.ru.md).\n\nSearch tool typos in the text, files and websites.\n\nUsed API [Yandex.Speller](https://tech.yandex.ru/speller/doc/dg/concepts/About-docpage/).\n\n![yaspeller](https://raw.githubusercontent.com/hcodes/yaspeller/master/images/cli.en.png)\n\n## Installation\n`npm install yaspeller -g`\n\n## Using CLI\n`yaspeller [options] \u003cfile-or-directory-or-link...\u003e`\n\n## Using with [pre-commit](https://pre-commit.com/)\n\nAdd this to your `.pre-commit-config.yaml`:\n\n```yaml\n- repo: https://github.com/hcodes/yaspeller.git\n  rev: '' # Use the sha / tag you want to point at\n  hooks:\n    - id: yaspeller\n```\n\n### Examples\n+ `yaspeller README.md` — search typos in the file.\n+ `yaspeller \"*.md\"` — node glob syntax for Windows.\n+ `yaspeller -e \".md,.html,.txt\" ./texts/` — finding typos in files in the folder.\n+ `yaspeller https://ru.wikipedia.org/wiki/%D0%9E%D0%BF%D0%B5%D1%87%D0%B0%D1%82%D0%BA%D0%B0` — search typos in the page.\n+ `yaspeller http://bem.info/sitemap.xml` — search typos at the addresses specified in the sitemap.xml.\n+ `echo \"Hello, world!\" | yaspeller --stdin`\n+ `echo \"Hello, world!\" | yaspeller --stdin --stdin-filename hello.txt`\n\n### Options\n\n#### `-f, --format \u003cvalue\u003e`\nFormats: `plain`, `html`, `markdown` or `auto`.\u003cbr/\u003e\nDefault: `auto`.\n\n#### `-l, --lang \u003cvalue\u003e`\nLanguages: `en`, `ru` or `uk`.\u003cbr/\u003e\nDefault: `en,ru`.\n\n#### `-c, --config \u003cpath\u003e`\nConfiguration file path.\n\n#### `-e, --file-extensions \u003cvalue\u003e`\nSet file extensions to search for files in a folder.\u003cbr/\u003e\nExample: `.md,.htm,.txt`.\n\n#### `--dictionary \u003cfile\u003e`\nJSON file for own dictionary.\n```js\n[\n    \"someword1\", // someword1 = someword1 and Someword1\n    \"Someword2\", // Someword2 = Someword2\n    \"someword3\"\n]\n```\n\nRegular expressions are supported:\n```js\n[\n    \"unknownword\",\n    \"unknown(W|w)ord[12]?\", // unknown(W|w)ord[12]? = unknown(W|w)ord[12]? and Unknown(W|w)ord[12]?\n    \"Unknown(W|w)ord[34]?\" // Unknown(W|w)ord[34]? = Unknown(W|w)ord[34]?\n]\n```\n\nExamples:\u003cbr/\u003e\n`yaspeller --dictionary my_dict.json .`\u003cbr/\u003e\n`yaspeller --dictionary my_dict.json:my_dict2.json .`\n\nIf you have tons of markdown and introduce this linter, you're likely to want\ngeneration of initial dictionary with [yaspeller-dictionary-builder](https://github.com/razum2um/yaspeller-dictionary-builder),\nso one line will cover all word's forms.\n\n#### `--report \u003ctype\u003e`\nSet type of report: `console`, `html`, `markdown`, `junit` or `json`.\u003cbr/\u003e\nDefault: `console`\u003cbr/\u003e\nExample: `console,html,custom_report.js`\n\n#### `--check-yo`\nCheck the correctness of using the letter “Ё” (Yo) in Russian texts.\n\n#### `--find-repeat-words`\nHighlight repetitions of words, consecutive. For example, `I flew to to to Cyprus`.\n\n#### `--ignore-tags \u003ctags\u003e`\nIgnore HTML tags.\u003cbr/\u003e\nDefault: `code,kbd,object,samp,script,style,var`\u003cbr/\u003e\nOption to formats `html` and` markdown`.\n\n#### `--ignore-text \u003cregexp\u003e`\nRemove the text from the scan using regular expressions.\n\n#### `--ignore-capitalization`\nIgnore the incorrect use of UPPERCASE / lowercase letters, for example, in the word `moscow`.\n\n#### `--ignore-digits`\nIgnore words with numbers, such as `avp17h4534`.\n\n#### `--ignore-urls`\nIgnore Internet addresses, email addresses and filenames.\n\n#### `--max-requests \u003cvalue\u003e`\nMax count of requests in parallel.\u003cbr/\u003e\nDefault: `2`.\n\n#### `--no-color`\nClean output without colors.\n\n#### `--only-errors`\nOutput only errors.\n\n#### `--stdin`\nProcess files on `\u003cSTDIN\u003e`. Default: false\n\n#### `--stdin-filename \u003cfile\u003e`\nSpecify filename to process `\u003cSTDIN\u003e` as. Used in reports.\n\n#### `--debug`\nDebug mode.\n\n## Configuration\n`npm install yaspeller --save-dev`\n\nAdd the text in `package.json` / `scripts`:\u003cbr/\u003e\n`    \"yaspeller\": \"yaspeller .\",`\n\nTo run the linter:\u003cbr/\u003e\n`npm run yaspeller`\n\n`yaspeller` is configured using JSON file at the root of the project:\n\n- `.yaspellerrc`\n- `.yaspellerrc.js`\n- `.yaspellerrc.json`\n- `.yaspeller.json`\n- `package.json`, field `yaspeller`\n\n```JSON\n{\n  \"excludeFiles\": [\n    \".git\",\n    \"libs\",\n    \"node_modules\",\n    \"yaspeller\"\n  ],\n  \"lang\": \"ru\",\n  \"fileExtensions\": [\n    \".md\",\n    \".css\"\n  ],\n  \"dictionary\": [\n    \"someword1\"\n  ]\n}\n```\n\n**Advanced example:**\n```js\n{\n  \"excludeFiles\": [\n    \".git\",\n    \"yaspeller\",\n    \"node_modules\",\n    \"libs\"\n  ],\n  \"format\": \"html\",\n  \"lang\": \"en\",\n  \"fileExtensions\": [\n    \".md\",\n    \".css\"\n  ],\n  \"report\": [\"console\", \"html\"],\n  \"dictionary\": [\n    // JSON comments\n    \"someword1\", // someword1 = someword1 and Someword1\n    \"Someword2\", // Someword2 = Someword2\n    \"some(w|W)ord[23]\", // some(w|W)ord[23] = some(w|W)ord[23] and Some(w|W)ord[23]\n    \"Some(w|W)ord\" // Some(w|W)ord = Some(w|W)ord\n  ],\n  \"ignoreText\": [\n    \"\u003cphp\\?[^]*?\\?\u003e\", // Shortly\n    [\"\u003cphp\\?[^]*?\\?\u003e\", \"g\"] // Longly\n  ],\n  \"ignoreTags\": [\"code\", \"script\"],\n  \"ignoreUrls\": true,\n  \"findRepeatWords\": true,\n  \"maxRequests\": 5\n}\n```\n\n| Property | Type | Details |\n|----------|------|---------|\n| `format` | `String` | [`--format`](#-f---format-value) |\n| `lang`   | `String` | [`--lang`](#-l---lang-value) |\n| `excludeFiles` | `Array` | |\n| `fileExtensions` | `Array` | [`--file-extension`](#--file-extensions-value) |\n| `dictionary` | `Array` | [`--dictionary`](#--dictionary-file) |\n| `report` | `Array` | [`--report`](#--report-type) |\n| `checkYo`    | `Boolean` | [`--check-yo`](#--check-yo) |\n| `findRepeatWords` | `Boolean` | [`--find-repeat-words`](#--find-repeat-words) |\n| `ignoreTags` | `Array` | [`--ignore-tags`](#--ignore-tags-tags) |\n| `ignoreText` | `Array` | [`--ignore-text`](#--ignore-text-regexp) |\n| `ignoreCapitalization` | `Boolean` | [`--ignore-capitalization`](#--ignore-capitalization) |\n| `ignoreDigits` | `Boolean` | [`--ignore-digits`](#--ignore-digits) |\n| `ignoreUrls` | `Boolean` | [`--ignore-urls`](#--ignore-urls) |\n| `maxRequests` | `Number` | [`--max-requests`](#--max-requests-value) |\n\n## Ignore text from checking\n### Ignore a line\n```js\nvar re = /a-z/; // yaspeller ignore\n```\n```js\nvar re = /a-z/; /* yaspeller ignore */\n```\n```html\n\u003cspan\u003ea-z\u003c/span\u003e \u003c!-- yaspeller ignore --\u003e\n```\n\n### Ignore a block\n```js\n/* yaspeller ignore:start */\nconst reUpper = /A-Z/;\nconst reLower = /a-z/;\n/* yaspeller ignore:end */\n```\n\n```html\n\u003c!-- yaspeller ignore:start --\u003e\n\u003cspan\u003eA-Z\u003c/span\u003e\n\u003cdiv\u003ea-z\u003c/div\u003e\n\u003c!-- yaspeller ignore:end --\u003e\n```\n\n## [Gulp](http://gulpjs.com) plugin\n```js\nconst gulp = require('gulp');\nconst run = require('gulp-run'); // npm install gulp-run --save-dev\n\ngulp.task('yaspeller', function (cb) {\n    run('./node_modules/.bin/yaspeller .').exec()\n        .on('error', function (err) {\n            console.error(err.message);\n            cb();\n        })\n        .on('finish', cb);\n});\n```\n\n## [Grunt](http://gruntjs.com) plugin\n```js\nmodule.exports = function(grunt) {\n    grunt.loadNpmTasks('grunt-shell'); // npm install grunt-shell --save-dev\n    grunt.initConfig({\n        shell: {\n            yaspeller: {\n                options: {stderr: false},\n                command: './node_modules/.bin/yaspeller .'\n            }\n        }\n    });\n    grunt.registerTask('lint', ['shell:yaspeller']);\n};\n```\n\n## [Restrictions API Yandex.Speller](http://legal.yandex.ru/speller_api/)\n\n## Links\n- [Yaspeller for CI](https://github.com/ai/yaspeller-ci)\n- [Github Action for Yaspeller](https://github.com/heytitle/github-action-yaspeller)\n\n## [License](./LICENSE.md)\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhcodes%2Fyaspeller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhcodes%2Fyaspeller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhcodes%2Fyaspeller/lists"}