superheroes
Advanced tools
+2
-2
| 'use strict'; | ||
| var uniqueRandomArray = require('unique-random-array'); | ||
| var superheroes = require('./superheroes.json'); | ||
| const uniqueRandomArray = require('unique-random-array'); | ||
| const superheroes = require('./superheroes.json'); | ||
| exports.all = superheroes; | ||
| exports.random = uniqueRandomArray(superheroes); |
+41
-47
| { | ||
| "name": "superheroes", | ||
| "version": "1.0.0", | ||
| "description": "Get superhero names", | ||
| "license": "MIT", | ||
| "repository": "sindresorhus/superheroes", | ||
| "bin": "cli.js", | ||
| "author": { | ||
| "name": "Sindre Sorhus", | ||
| "email": "sindresorhus@gmail.com", | ||
| "url": "sindresorhus.com" | ||
| }, | ||
| "engines": { | ||
| "node": ">=0.10.0" | ||
| }, | ||
| "scripts": { | ||
| "test": "node test.js" | ||
| }, | ||
| "files": [ | ||
| "index.js", | ||
| "cli.js", | ||
| "superheroes.json" | ||
| ], | ||
| "keywords": [ | ||
| "cli-app", | ||
| "cli", | ||
| "bin", | ||
| "word", | ||
| "words", | ||
| "list", | ||
| "array", | ||
| "random", | ||
| "rand", | ||
| "superheroes", | ||
| "superhero", | ||
| "heroes", | ||
| "hero", | ||
| "marvel", | ||
| "dc", | ||
| "comics" | ||
| ], | ||
| "dependencies": { | ||
| "meow": "^3.0.0", | ||
| "unique-random-array": "^1.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "ava": "0.0.4" | ||
| } | ||
| "name": "superheroes", | ||
| "version": "2.0.0", | ||
| "description": "Get superhero names", | ||
| "license": "MIT", | ||
| "repository": "sindresorhus/superheroes", | ||
| "author": { | ||
| "name": "Sindre Sorhus", | ||
| "email": "sindresorhus@gmail.com", | ||
| "url": "sindresorhus.com" | ||
| }, | ||
| "engines": { | ||
| "node": ">=6" | ||
| }, | ||
| "scripts": { | ||
| "test": "xo && ava" | ||
| }, | ||
| "files": [ | ||
| "index.js", | ||
| "superheroes.json" | ||
| ], | ||
| "keywords": [ | ||
| "word", | ||
| "words", | ||
| "list", | ||
| "array", | ||
| "random", | ||
| "superheroes", | ||
| "superhero", | ||
| "heroes", | ||
| "hero", | ||
| "marvel", | ||
| "dc", | ||
| "comics" | ||
| ], | ||
| "dependencies": { | ||
| "unique-random-array": "^1.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "ava": "*", | ||
| "xo": "*" | ||
| } | ||
| } |
+10
-30
@@ -5,5 +5,5 @@ # superheroes [](https://travis-ci.org/sindresorhus/superheroes) | ||
|  | ||
| <img src="https://cloud.githubusercontent.com/assets/170270/7563453/ad57a684-f7dd-11e4-8302-081f132e8653.png" width="100" height="112" align="right"> | ||
| The list is just a [JSON file](superheroes.json) and can be used wherever. | ||
| The list is just a [JSON file](superheroes.json) and can be used anywhere. | ||
@@ -14,3 +14,3 @@ | ||
| ``` | ||
| $ npm install --save superheroes | ||
| $ npm install superheroes | ||
| ``` | ||
@@ -22,3 +22,3 @@ | ||
| ```js | ||
| var superheroes = require('superheroes'); | ||
| const superheroes = require('superheroes'); | ||
@@ -34,3 +34,3 @@ superheroes.random(); | ||
| Type: `array` | ||
| Type: `Array` | ||
@@ -41,3 +41,3 @@ Superhero names in alphabetical order. | ||
| Type: `function` | ||
| Type: `Function` | ||
@@ -47,31 +47,11 @@ Random superhero name. | ||
| ## CLI | ||
| ``` | ||
| $ npm install --global superheroes | ||
| ``` | ||
| ``` | ||
| $ superheroes --help | ||
| Examples | ||
| $ superheroes | ||
| Spider-Ham | ||
| $ superheroes --all | ||
| 3-D Man | ||
| A-Bomb | ||
| ... | ||
| Options | ||
| --all Get all names instead of a random name | ||
| ``` | ||
| ## Related | ||
| - [superheroes-cli](https://github.com/sindresorhus/superheroes-cli) - CLI for this module | ||
| - [supervillains](https://github.com/sindresorhus/supervillains) - Get supervillain names | ||
| - [cat-names](https://github.com/sindresorhus/cat-names) - Get popular cat names | ||
| - [dog-names](https://github.com/sindresorhus/dog-names) - Get popular dog names | ||
| - [pokemon](https://github.com/sindresorhus/pokemon) - Get Pokémon names | ||
| - [superb](https://github.com/sindresorhus/superb) - Get superb like words | ||
| - [yes-no-words](https://github.com/sindresorhus/yes-no-words) - Get yes/no like words | ||
@@ -81,2 +61,2 @@ | ||
| MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
| MIT © [Sindre Sorhus](https://sindresorhus.com) |
-22
| #!/usr/bin/env node | ||
| 'use strict'; | ||
| var meow = require('meow'); | ||
| var superheroes = require('./'); | ||
| var cli = meow({ | ||
| help: [ | ||
| 'Examples', | ||
| ' $ superheroes', | ||
| ' Spider-Ham', | ||
| '', | ||
| ' $ superheroes --all', | ||
| ' 3-D Man', | ||
| ' A-Bomb', | ||
| ' ...', | ||
| '', | ||
| 'Options', | ||
| ' --all Get all names instead of a random name' | ||
| ].join('\n') | ||
| }); | ||
| console.log(cli.flags.all ? superheroes.all.join('\n') : superheroes.random()); |
Sorry, the diff of this file is not supported yet
1
-50%28287
-1.88%2
100%5
-16.67%1832
-1.08%56
-26.32%- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed