0.1.0 • Published 8 years ago
which-hero v0.1.0
Which Hero
About
Which Hero is vanity package for randomly selecting a fictional hero or villain.
Installation
- Navigate to the root of your project and run:
npm install --save which-hero.
Setup
CommonJS
- Within any project script(s),
requirethewhich-herolibrary as follows:
var whichHero = require( 'which-hero' );Usage
- The
which-heromodule exposes thewhichHerofunction. whichHerocan be invoked with or without arguments. In either case, the return value will be of typeobject.
Without Arguments
var hero = whichHero(); // { name: 'Batman', type: 'hero' }With arguments
var hero = whichHero( { only: [ 'name' ] } ); // { name: 'Robin' }var villain = whichHero( { restrict: 'VILLAINS' } ); // { name: 'The Joker', type: 'villain' }Documentation
Documentation for the which-hero module lives directly within lib/which-hero.js.
0.1.0
8 years ago