Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

yaspeller

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaspeller

Search tool typos in the text, files and websites

  • 2.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.4K
decreased by-11.06%
Maintainers
1
Weekly downloads
 
Created
Source

yaspeller

NPM version NPM Downloads Build Status Coverage Status
Dependency Status devDependency Status

This README is also available in Russian.

Search tool typos in the text, files and websites.

Used API Yandex.Speller.

yaspeller

Installation

npm install yaspeller -g

Using CLI

yaspeller [options] <file-or-directory-or-link...>

Examples

  • yaspeller README.md — search typos in the file.
  • yaspeller -e ".md,.html,.js" ./texts/ — finding typos in files in the folder.
  • 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.
  • yaspeller http://bem.info/sitemap.xml — search typos at the addresses specified in the sitemap.xml.

Options

-f, --format <value>

Formats: plain, html, markdown или auto.
Default: auto.

-l, --lang <value>

Languages: en, ru or uk.
Default: en,ru.

-c, --config <path>

Configuration file path.

-e, --file-extensions <value>

Set file extensions to search for files in a folder.
Example: .md,.htm,.txt.

--dictionary <file>

JSON file for own dictionary.

[
    "someword1",
    "someword2",
    "someword3"
]

Regular expressions are supported:

[
    "someword1", // JSON comments
    "/(S|s)omeword2/",
    "/someword3/i"
]

Examples:
yaspeller --dictionary my_dict.json .
yaspeller --dictionary my_dict.json:my_dict2.json .

--report <type>

Set type of report: console, html, markdown or json.
Default: console
Example: console,html,custom_report.js

--check-yo

Check the correctness of using the letter “Ё” (Yo) in Russian texts.

--by-words

Do not use a dictionary environment (context) during the scan.
This is useful in cases where the service is transmitted to the input of a list of individual words.

--find-repeat-words

Highlight repetitions of words, consecutive. For example, I flew to to to Cyprus.

--flag-latin

Celebrate words, written in Latin, as erroneous.

--ignore-tags <tags>

Ignore HTML tags.
Default: code,kbd,object,samp,script,style,var
Option to formats html and markdown.

--ignore-capitalization

Ignore the incorrect use of UPPERCASE / lowercase letters, for example, in the word moscow.

--ignore-digits

Ignore words with numbers, such as avp17h4534.

--ignore-latin

Ignore words, written in Latin, for example, madrid.

--ignore-roman-numerals

Ignore Roman numerals I, II, III, ....

--ignore-uppercase

Ignore words written in capital letters.

--ignore-urls

Ignore Internet addresses, email addresses and filenames.

--max-requests <value>

Max count of requests at a time.
Default: 2.

--no-colors

Clean output without colors.

--only-errors

Output only errors.

--debug

Debug mode.

Configuration

npm install yaspeller --save-dev

Add the text in package.json / scripts:
"yaspeller": "./node_modules/.bin/yaspeller .",

To run the linter:
npm run yaspeller

Yaspeller is configured using .yaspellerrc JSON file at the root of the project.

{
  "excludeFiles": [
    ".git",
    "libs",
    "node_modules",
    "yaspeller"
  ],
  "lang": "ru",
  "fileExtensions": [
    ".md",
    ".js",
    ".css"
  ],
  "dictionary": [
    "someword1"
  ]
}

Advanced example:

{
  "excludeFiles": [
    ".git",
    "yaspeller",
    "node_modules",
    "libs"
  ],
  "format": "html",
  "lang": "en",
  "fileExtensions": [
    ".md",
    ".js",
    ".css"
  ],
  "report": ["console", "html"],
  "dictionary": [
    "someword1", // JSON comments
    "/(S|s)omeword2/"
  ],
  "ignoreTags": ["code", "script"],
  "ignoreUrls": true,
  "findRepeatWords": true,
  "maxRequests": 5
}
Property TypeDetails
formatString--format
langString--lang
excludeFilesArray
fileExtensionsArray--file-extension
dictionaryArray--dictionary
reportArray--report
checkYoBoolean--check-yo
byWordsBoolean--by-words
findRepeatWordsBoolean--find-repeat-words
flagLatinBoolean--flag-latin
ignoreTagsArray--ignore-tags
ignoreCapitalizationBoolean--ignore-capitalization
ignoreDigitsBoolean--ignore-digits
ignoreLatinBoolean--ignore-latin
ignoreRomanNumeralsBoolean--ignore-roman-numerals
ignoreUppercaseBoolean--ignore-uppercase
ignoreUrlsBoolean--ignore-urls
maxRequestsNumber--max-requests

Ignore text from checking

Ignore a line

var re = /a-z/; // yaspeller ignore
var re = /a-z/; /* yaspeller ignore */
<span>a-z</span> <!-- yaspeller ignore -->

Ignore a block

/* yaspeller ignore:start */
var reUpper = /A-Z/,
    reLower = /a-z/;
/* yaspeller ignore:end */
<!-- yaspeller ignore:start -->
<span>A-Z</span>
<div>a-z</div>
<!-- yaspeller ignore:end -->

Gulp plugin

var gulp = require('gulp'),
    run = require('gulp-run'); // npm install gulp-run --save-dev

gulp.task('yaspeller', function (cb) {
    run('./node_modules/.bin/yaspeller .').exec()
        .on('error', function (err) {
            console.error(err.message);
            cb();
        })
        .on('finish', cb);
});

Grunt plugin

module.exports = function(grunt) {
    grunt.loadNpmTasks('grunt-shell'); // npm install grunt-shell --save-dev
    grunt.initConfig({
        shell: {
            yaspeller: {
                options: {stderr: false},
                command: './node_modules/.bin/yaspeller .'
            }
        }
    });
    grunt.registerTask('lint', ['shell:yaspeller']);
};

Restrictions API Yandex.Speller

License

MIT License

Keywords

FAQs

Package last updated on 31 May 2015

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