npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

misspell

v1.2.1

Published

Reverse spellcheck

Downloads

21

Readme

Misspell

This is a JavaScript reverse spellchecker. It takes words and screws up the spelling and capitalisation.

Usage

Include misspell.js in your project with a <script> tag or via npm install misspell. Then you can require it and use it right away!

var misspell = require("misspell") // if you haven't included it with a script tag

var misspelledText = misspell(text, capitalisation[, capsTypes, mispellPercent])
// text: the string you would like to process
// capitalisation: boolean, set this to true or false depending on if you want the capitalisation to be changed.
// capsTypes (optional): an array of the capitalisation modes you want to enable. of the array of modes you supply, a random mode will be chosen. if you don't supply an array of specific modes, a random mode will be chosen out of every possible mode.
    // LIST OF CAPITALISATION MODES
    // mode 1: jaden smith mode, capitalises the first letter of each word in the string
    // mode 2: random jaden smith mode, sometimes capitalises the first letter of randomly picked words from the string
    // mode 3: uppercase mode, makes whole string uppercase
    // mode 4: lowercase mode, makes whole string lowercase
    // mode 5: totally screwed up mode, each character is randomly made uppercase or lowercase
    // mode 6: "tumblr" mode, begins a string normally and eventually at a random place goES INTO ALL CAPS AND CONTINUES TO BE ALL CAPS UNTIL THE END OF THE STRING
// an example of a value you can supply for capsTypes is [1, 3, 5], which only allows jaden smith mode, uppercase mode, and totally screwed up mode.
// misspellPercent (optional): percent likelihood of messing up with spelling.

You can also play around with misspell.js like a CLI. Run it with node and pass the same arguments you'd pass to it as a function in the same order and it'll pipe out the result.

Reverse Spellcheck Dictionary

Part of what made this project possible is the Wikipedia machine readable list of common misspellings. I wrote a script to take that and make it into a nice JSON file, which sits in the folder reverse-spellcheck/. Feel free to use it to serialize your own files.

Close Letters On Keyboard JSON File

This is a JSON file that includes each letter on a QWERTY keyboard and an array with the surrounding letters. Feel free to use it anyplace you like.

Using Misspell On The Client Side

If you plan to use Misspell in a web based HTML document, it is important to include the failsafe file misspell-dependencies.js in a place accessible by Misspell. This is in place because Misspell needs the files keyboard-close.json and reverse-spellcheck.json, and while it tries to run an HTTP request to get them, it doesn't always work due to CORS, disorganization, and many other potential issues.

License

The reverse spellcheck JSON file is under public domain. I didn't think I'd need to copyright it considering I didn't really make it myself, I just formatted it right.

The rest of the code is under the MIT License, © Ethan Arterberry 2016.