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

typo-js

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typo-js

A Hunspell-style spellchecker.

  • 1.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is typo-js?

The typo-js npm package is a JavaScript library for spell checking. It uses Hunspell dictionaries to provide spell checking functionalities, which makes it highly customizable and capable of supporting multiple languages.

What are typo-js's main functionalities?

Spell Checking

This feature allows you to check if a word is spelled correctly. In this example, the word 'example' is checked against the 'en_US' dictionary.

const Typo = require('typo-js');
const dictionary = new Typo('en_US');
const isCorrect = dictionary.check('example');
console.log(isCorrect); // true

Suggesting Corrections

This feature provides suggestions for misspelled words. In this example, the word 'exampel' is misspelled, and the dictionary suggests 'example', 'exemplar', and 'exemplary' as corrections.

const Typo = require('typo-js');
const dictionary = new Typo('en_US');
const suggestions = dictionary.suggest('exampel');
console.log(suggestions); // ['example', 'exemplar', 'exemplary']

Loading Custom Dictionaries

This feature allows you to load custom dictionaries from a specified path. In this example, the 'en_US' dictionary is loaded from a custom path.

const Typo = require('typo-js');
const dictionary = new Typo('en_US', false, false, { dictionaryPath: '/path/to/dictionaries' });
const isCorrect = dictionary.check('example');
console.log(isCorrect); // true

Other packages similar to typo-js

Keywords

FAQs

Package last updated on 12 Feb 2024

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