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

boring-name-generator

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boring-name-generator

Generateing a random, unique, heroku-like name for the motherbored. e.g. "gnarly-yield-2913"

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
169K
decreased by-13.95%
Maintainers
1
Weekly downloads
 
Created
Source

Boring Name Generator

Generateing a boring, random, unique, heroku-like name for each motherbored. e.g. "gnarly-yield-2913"

Useful for object names, temp folders, group ids, unique ids etc...

Install

npm install boring-name-generator --save

Quick Start

var generate = require('boring-name-generator');

generate().dashed; // 'uptight-guitar'

generate().spaced; // 'grandiose clam'

generate().raw; // ['deluxe', 'grandmother']

generate({ number: true }).dashed; // 'disgraceful-temper-7794'

generate({ words: 4 }).raw; // ['tiny', 'crabby', 'wired', 'quicksand']

generate({ words: 4, number: true }).dashed; // 'breakable-judicious-luxuriant-tax-3931'

generate({ words: 2, alliterative: true }).spaced; // 'elegant experience'

Quickstart CLI

This package contains a cli script. You can pull in the package globally using npm npm install -g boring-name-generator

Call from your command line

$ boring-name-generator
{ raw: [ 'spry', 'bath' ],
  dashed: 'spry-bath',
  spaced: 'spry bath' }

For CLI options

boring-name-generator -h

Usage: boring-name-generator [options]


Options:

  -V, --version          output the version number
  -w, --words [num]      number of words [2]
  -n, --numbers          use numbers
  -a, --alliterative     use alliterative
  -o, --output [output]  output type [raw|dashed|spaced]
  -h, --help             output usage information

API

The module returns a single function, generate(options)

Calling generate() with no arguments will return an object:

{
    raw: ['whispering', 'valley'],
    dashed: 'whispering-valley',
    spaced: 'whispering valley'
}

The options argument object can have properties

  • words (number) - Number of words generated (excluding number). All words will be adjectives, except the last one which will be a noun. Defaults to 2.
  • number (boolean) - Whether a numeric suffix is generated or not. The number is between 1 - 9999, both inclusive. Defaults to false.
  • alliterative (boolean) - Whether to output words beginning with the same letter or not. Defaults to false.

generate({ words: 3 }) will return:

{
    raw: ['harmonious', 'endurable', 'substance'],
    dashed: 'harmonious-endurable-substance',
    spaced: 'harmonious endurable substance'
}

generate({ words: 5, number: true }) will return:

{
  raw: [ 'exciting', 'cooperative', 'legal', 'lackadaisical', 'blood', 4099 ],
  dashed: 'exciting-cooperative-legal-lackadaisical-blood-4099',
  spaced: 'exciting cooperative legal lackadaisical blood 4099'
}

generate({ words: 2, number: false, alliterative: true }) will return:

{
  raw: [ 'elegant', 'experience' ],
  dashed: 'elegant-experience',
  spaced: 'elegant experience'
}

Tests

To run tests locally:

npm install

npm test

The library has been tested with Node.js 12.18.4

Keywords

FAQs

Package last updated on 12 Oct 2022

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