Git Product home page Git Product logo

doctor-who's Introduction

logo

Doctor Who companions

Weekly Downloads Build Status Coverage Status npm bundle size GitHub package.json version Licence Badge

Doctor Who names: a simple and small npm package to get Doctor Who characters names. Can be useful for data anonymization or username placeholder.

const Generator = require('doctor-who');
const gen = new Generator();

gen.random(); // 'Rory Williams'
gen.all(); // ['Amy Pond', 'Rose Tyler', ... ]
gen.get(2); // ['River Song', 'Clara Oswald']

Installation

Use yarn or npm to install this package:

npm install --global doctor-who
# or
yarn global add doctor-who

API

constructor(doctors = 'all', language = 'en')

Create a new generator instance. You could choose the language in parameter and which Doctor companions to choose.

const Generator = require('doctor-who');

const gen = new Generator();
// Same as:
const gen = new Generator('all', 'en');
const Generator = require('doctor-who');

// Will generate names from only the companions of the 10th and 11th Doctor.
const gen = new Generator([11, 10]);

// Will generate names from the companions of all Doctors.
const gen = new Generator('all');

// Will generate names from the companions of only the 12th doctor.
const gen = new Generator([12]);

random()

Return a random name of a character in Doctor Who.

const Generator = require('doctor-who');
const gen = new Generator();

gen.random(); // Amy Pond

all()

Return an array containing all names.

const Generator = require('doctor-who');
const gen = new Generator();

gen.all(); // ['Amy Pond', 'Rose Tyler', ... ]

get(count = 1)

Return an array containing count names.

const Generator = require('doctor-who');
const gen = new Generator();

gen.get(2); // ['Amy Pond', 'Rose Tyler']

Cli

This tool can also be used from the command line.

$ doctor-who
Amy pond

Usage

$ doctor-who -h
Usage: datamanager [options]

get a random value

Options:
  -V, --version              output the version number
  -a, --all                  get all values
  -l, --language <language>  specify language. Available languages are: en (default: "en")
  -c, --count <n>            get n values
  -r, --random               get a random value. Same as without options
  -h, --help                 output usage information

Languages

The currently available languages for the names are:

Add yours !

Contribute

Pull requests are welcome ! Feel free to contribute.

Credit

MIT Licensing. Coded by Corentin Thomasset

doctor-who's People

Contributors

corentinth avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

snanalyst

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.