Skip to content

Generate typical typing errors for any given string

Notifications You must be signed in to change notification settings

cl0ckwork/node-typojs-wp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TypoJS

Humans make a lot of typos. This software tries to behave as human as possible in this aspect. Project forked to remove shebang in order to use with webpack.

Typo Generators

Standard

  • Keyboard Mishit – Typicak keyboard mishits based on QUERTY and QUERTZ keyboard layouts
  • Double Characters – Hittingg a character twice
  • Missing Characters – Nt hitting a character
  • Mixing Characters – Mixign up two neighbouring characters

Extended

  • Sausage Fingers - Typicakl second keys accidentially pressed when hitting between keys
  • Character Shift - Hittgin a character two positions too soon or too late
  • Character Flip - Mixgni two characters by two positions

Installation

npm install typojs

Methods

var typo = require("typojs");

typo(string, extended, callback(typos))

  • string is a String you want to get typos for
  • extended generates more, less common typos (optional)
  • callback is a callback method with all generated typos as first argument (optional)

If no callback method is specified, the generated typos will be returned instead.

Example

var typo = require("typojs");

/* with callback */
typo("Whatever", true, function(typos){
	console.log(typos);
});

/* without callback */
console.log(typo("Whatever", true));

Dedication

This software is dedicated to my dear friend, the Imperator of Cucumbers, who makes a lot of typos.

License

TypoJS is Unlicensed Public Domain.

Flattr

Flattr this git repo

About

Generate typical typing errors for any given string

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%