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 - npm Package Compare versions

Comparing version 7.2.1 to 8.0.0

5

CHANGELOG.md
# Changelog
## v8.0.0
- Yaspeller requires Node.js 12 or higher.
- Reducing the size of dependencies #178 @alchazov.
- CLI `no-colors` option replaced with `no-color`.
## v7.2.1

@@ -4,0 +9,0 @@ - --ignore-tags Not work properly in Markdown files with HTML #176

4

lib/cli/index.js
'use strict';
const async = require('async');
const chalk = require('chalk');
const program = require('commander');

@@ -20,5 +19,2 @@

setDebugMode(program.debug);
if (!program.colors) {
chalk.level = 0;
}

@@ -25,0 +21,0 @@ const mergedOptions = getMergedOptions(program.config);

@@ -33,3 +33,3 @@ 'use strict';

.option('--dictionary <file>', 'json file for own dictionary', value => splitTrim(value, ':'))
.option('--no-colors', 'clean output without colors')
.option('--no-color', 'clean output without colors')
.option('--report <type>', 'generate a report: console, text, html or json. Default: "console"', splitByCommas)

@@ -36,0 +36,0 @@ .option('--ignore-tags <tags>', `ignore tags. Default: "${defaultConfig.ignoreTags.join(',')}"`, splitByCommas)

'use strict';
const cosmiconfig = require('cosmiconfig').cosmiconfigSync;
const lilconfig = require('lilconfig').lilconfigSync;
const stripJsonComments = require('strip-json-comments');
const parseJson = require('parse-json');
const sjson = require('secure-json-parse');
const path = require('path');

@@ -15,3 +15,3 @@

try {
return parseJson(stripJsonComments(content));
return sjson.parse(stripJsonComments(content));
} catch (err) {

@@ -34,3 +34,3 @@ err.message = `JSON Error in ${filepath}:\n${err.message}`;

function getConfig(file) {
const explorer = cosmiconfig('yaspeller', {
const explorer = lilconfig('yaspeller', {
loaders: {

@@ -37,0 +37,0 @@ '.json': loadJson,

const chalk = require('chalk');
const pico = require('picocolors');

@@ -12,15 +12,15 @@ const { jsonStringify } = require('./string');

function consoleInfo(data) {
console.info(chalk.cyan(data));
console.info(pico.cyan(data));
}
function consoleWarn(data) {
console.warn(chalk.yellow(data));
console.warn(pico.yellow(data));
}
function consoleError(data) {
console.error(chalk.red(data));
console.error(pico.red(data));
}
function consoleOk(data) {
console.log(chalk.green(data));
console.log(pico.green(data));
}

@@ -35,3 +35,3 @@

if (isDebugMode()) {
const prefix = chalk.cyan('[DEBUG]');
const prefix = pico.cyan('[DEBUG]');
if (typeof text === 'object' && text) {

@@ -41,3 +41,3 @@ console.log(prefix);

Object.keys(text).forEach(key => {
console.log(chalk.cyan(' ' + key + ': ') + jsonStringify(text[key]));
console.log(pico.cyan(' ' + key + ': ') + jsonStringify(text[key]));
});

@@ -44,0 +44,0 @@ } else {

'use strict';
const chalk = require('chalk');
const pico = require('picocolors');
const program = require('commander');

@@ -39,16 +39,16 @@

if (pos.length) {
comment.push(chalk.cyan(pos[0].line + ':' + pos[0].column));
comment.push(pico.cyan(pos[0].line + ':' + pos[0].column));
}
if (el.count > 1) {
comment.push(chalk.cyan('count: ' + el.count));
comment.push(pico.cyan('count: ' + el.count));
}
if (hasEngRusLetters(el.word)) {
comment.push(chalk.red('en: ' + replaceRusLettersWithAsterisk(el.word)));
comment.push(chalk.green('ru: ' + replaceEngLettersWithAsterisk(el.word)));
comment.push(pico.red('en: ' + replaceRusLettersWithAsterisk(el.word)));
comment.push(pico.green('ru: ' + replaceEngLettersWithAsterisk(el.word)));
}
if (el.suggest) {
comment.push(chalk.cyan('suggest: ' + el.suggest.join(', ')));
comment.push(pico.cyan('suggest: ' + el.suggest.join(', ')));
}

@@ -74,3 +74,3 @@

if (hasManyErrors(data.data)) {
errors.push(chalk.red('Too many errors\n'));
errors.push(pico.red('Too many errors\n'));
}

@@ -81,3 +81,3 @@

if (typos.length) {
errors.push(chalk.red(el.title + ': ' +
errors.push(pico.red(el.title + ': ' +
typos.length + '\n') +

@@ -88,4 +88,4 @@ typos.join('\n') + '\n');

const time = data.time ? ' ' + chalk.magenta(data.time + ' ms') : '';
const separator = chalk.red('-----\n');
const time = data.time ? ' ' + pico.magenta(data.time + ' ms') : '';
const separator = pico.red('-----\n');

@@ -95,10 +95,10 @@ let res = data.resource;

if (isUrl(res)) {
res = chalk.underline(res);
res = pico.underline(res);
}
if (errors.length) {
console.error(chalk.red(errorSymbol) + ' ' + res + time + '\n' +
console.error(pico.red(errorSymbol) + ' ' + res + time + '\n' +
separator + errors.join('\n') + separator);
} else {
console.log(chalk.green(okSymbol) + ' ' + res + time);
console.log(pico.green(okSymbol) + ' ' + res + time);
}

@@ -105,0 +105,0 @@ }

@@ -11,4 +11,3 @@ 'use strict';

const yaspellerApi = require('yandex-speller');
const MarkdownIt = require('markdown-it');
const md = new MarkdownIt({ html: true });
const marked = require('marked');

@@ -67,3 +66,3 @@ const eyo = require('./plugins/eyo');

if (format === 'markdown') {
text = md.render(text);
text = marked(text);
}

@@ -70,0 +69,0 @@

@@ -13,3 +13,3 @@ {

"description": "Search tool typos in the text, files and websites",
"version": "7.2.1",
"version": "8.0.0",
"license": "MIT",

@@ -36,6 +36,4 @@ "homepage": "https://github.com/hcodes/yaspeller",

"dependencies": {
"async": "^3.2.1",
"chalk": "^4.1.2",
"async": "^3.2.2",
"commander": "^3.0.0",
"cosmiconfig": "^7.0.1",
"entities": "^3.0.1",

@@ -46,6 +44,8 @@ "escape-html": "^1.0.3",

"isutf8": "^3.1.1",
"markdown-it": "^12.2.0",
"lilconfig": "^2.0.3",
"marked": "^3.0.8",
"minimatch": "^3.0.4",
"node-fetch": "^2.6.2",
"parse-json": "^5.2.0",
"picocolors": "^1.0.0",
"secure-json-parse": "^2.4.0",
"strip-json-comments": "^3.1.1",

@@ -63,3 +63,3 @@ "xml2js": "^0.4.23",

"engines": {
"node": ">=10"
"node": ">=12"
},

@@ -66,0 +66,0 @@ "scripts": {

@@ -6,2 +6,3 @@ yaspeller

[![Coverage Status](https://img.shields.io/coveralls/hcodes/yaspeller.svg)](https://coveralls.io/r/hcodes/yaspeller)
[![install size](https://packagephobia.com/badge?p=yaspeller)](https://packagephobia.com/result?p=yaspeller)

@@ -135,3 +136,3 @@ <img align="right" width="200" src="https://raw.githubusercontent.com/hcodes/yaspeller/master/images/logo.png" />

#### `--no-colors`
#### `--no-color`
Clean output without colors.

@@ -138,0 +139,0 @@

@@ -126,3 +126,3 @@ yaspeller

#### `--no-colors`
#### `--no-color`
Консольный вывод без цвета.

@@ -129,0 +129,0 @@

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