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

phonetic

v0.1.1

Published

Generates unique, pronounceable names, random and seedable

Downloads

3,319

Readme

Phonetic

Generates unique, pronounceable names, random and seedable

Installation

In your project folder, type:

npm install phonetic

Usage

Just require it...

var phonetic = require('phonetic');

Need a name?

phonetic.generate();
// "Stratulis"
phonetic.generate();
// "Quibapop"

Need a shorter name?

phonetic.generate({ syllables: 2 });
// "Neelam"

Need to generate the same name based on some user info?

phonetic.generate({ seed: '127.0.0.1' })
// "Pokenoop"
phonetic.generate({ seed: '127.0.0.1' })
// "Pokenoop"

Details

Phonetic generates a randomized, pronounceable word. Use it to assign pronounceable hostnames to your server cluster so you don't have to refer to machines by random letters or numbers, or use it to suggest a unique username to your site's visitors. Keep the name the same every time by seeding it with a unique cookie, or maybe the user's IP + user agent.

Words are generated by transforming the seed using a series of MD5 hashes and calculations that make it impossible for users to game the system and coerce out a chosen word. The process is synchronous, but takes mere nanoseconds.

Generated words have an English-leaning format, using phonetics that are more common in the English language and avoiding more international sounds. This could be changed by packaging the phonetic sets and replacements into modules which can be selected through the options at run time. A hint to those who would like to get involved with the project!

The function call looks like this:

phonetic.generate([options])

Options

The following options are available:

syllables

Default: 3. The number of syllables to put in the resulting word.

seed

Default: (random). A string or number with which to seed the generator. Using the same seed (with the same other options) will coerce the generator into producing the same word each time.

phoneticSimplicity

Default: 5. The greater this number, the simpler the phonetics. For example, 1 might produce 'str' while 5 might produce 's' for the same syllable. Minimum is 1.

compoundSimplicity

Default: 5. The greater this number, the less likely the resulting word will sound "compound", such as "ripkuth" instead of "riputh". Minimum is 1.

capFirst

Default: true. true to capitalize the first letter of the word; all lowercase otherwise.

License

Phonetic is distributed under the MIT license. See LICENSE.txt for details.

Credits

Phonetic was created by Tom Shawver in 2013 to ease the transition from lurking to contributing.