Coder Social home page Coder Social logo

project-name-generator's Introduction

⚰️ ⚰️ DEPRECATED ⚰️ ⚰️

This project is no longer being supported.

Project Name Generator

Generate quirky names like spiffy-waterfall, sassy-bread, mature-dew-8239 to use wherever you need a random but memorable name.

Useful for object names, temp folders, passwords, project names, unique ids etc

Install

npm install project-name-generator --save

Quick Start

var generate = require('project-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 project-name-generator

Call from your command line

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

For CLI options

project-name-generator -h

Usage: project-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

Status

How up-to-date are dependencies?

project-name-generator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

project-name-generator's Issues

Option to add word lists?

Hi! It would be great if the generate function options could be expanded to allow for additional word lists. This would allow custom word lists to expand the vocabulary of the generator.

Tests fail with error

Reproduce with the following steps:

  1. check out repository
  2. npm install
  3. npm test

I get the following stack trace:

$ npm test

> [email protected] test /Users/kevin/code/project-name-generator
> gulp test

(node:14787) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[10:18:03] Using gulpfile ~/code/project-name-generator/gulpfile.js
[10:18:03] Starting 'test'...
[10:18:03] 'test' errored after 14 ms
[10:18:03] Error: Cannot find module '../node_modules/jasmine-core/lib/jasmine-core/jasmine.js'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/kevin/code/project-name-generator/node_modules/minijasminenode2/lib/index.js:5:22)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
npm ERR! Test failed.  See above for more details.

I'm using npm 3. I think minijasminenode2 is expecting a different file hierarchy for the node_modules directory.

404 Not found for API when doing npm install

404 Not Found - GET https://mmrepo.jfrog.io/mmrepo/api/npm/npm-virtual/oolong/-/oolong-1.15.1.tgz

Command line message after doing npm install:

npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated [email protected]: "Please update to latest v2.3 or v2.2"
npm WARN deprecated [email protected]: Fixed a prototype pollution security issue in 4.1.0, please upgrade to ^4.1.1 or ^5.0.1.
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm notice
npm notice New minor version of npm available! 8.1.0 -> 8.5.5
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.5.5
npm notice Run npm install -g [email protected] to update!
npm notice
npm ERR! code E404
npm ERR! 404 Not Found - GET https://mmrepo.jfrog.io/mmrepo/api/npm/npm-virtual/oolong/-/oolong-1.15.1.tgz
npm ERR! 404
npm ERR! 404  'oolong@https://mmrepo.jfrog.io/mmrepo/api/npm/npm-virtual/oolong/-/oolong-1.15.1.tgz' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

wich version of node pls

with 18

npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated [email protected]: Fixed a prototype pollution security issue in 4.1.0, please upgrade to ^4.1.1 or ^5.0.1.
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm ERR! code E403
npm ERR! 403 403 Forbidden - GET https://mmrepo.jfrog.io/mmrepo/api/npm/npm-virtual/wrappy/-/wrappy-1.0.2.tgz
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-08-08T21_05_17_787Z-debug-0.log

Dependabot couldn't authenticate with mmrepo.jfrog.io/mmrepo/api/npm/npm-virtual

Dependabot couldn't authenticate with mmrepo.jfrog.io/mmrepo/api/npm/npm-virtual.

Please note that for JFrog repositories Dependabot needs to have deploy permission (as JFrog requires this for Dependabot to access uncached artifacts).

You can provide authentication details in your Dependabot dashboard by clicking into the account menu (in the top right) and selecting 'Config variables'.

You can mention @dependabot in the comments below to contact the Dependabot team.

Run as command line tool

Forgive if this is a dumb/obvious question, I don't know much about node/npm.

Is there any to run this as a command line tool easily? Right now I have a wrapper script called node - console.log(require("project-name-generator").generate().dashed), but I can't get that to work without having a random node project with this module installed to it locally (not sure why a global install isn't working). It'd be great to be able to type project-name-generator -w 2 -n in terminal and get a name (2 words with a number in that example) though.

Is there an easy way to do that that I'm missing, or is that just not in this project? (and if it isn't, do you have any plans to add that?) or a way to install this globally

Upsetting, ablelist, sexist, and other offensive words included in corpus

i was using this project as part of the p5.js Web Editor, but ended up removing it as it was possible to generate upsetting and offensive project names (see processing/p5.js-web-editor#1026).

i recommend removing words that in any context could be offensive, or juxtaposed with specific words could be offensive, or words that feel out of context for a project name. some recommendations are, but not limited to: aboriginal, abortive, alcoholic, xenophobic... there are quite a lot of words that i think should be removed.

thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.