Skip to content

dkaushikl/typescript-utility

Repository files navigation

typescript-utility

Get random character names

Build Status Code Coverage version MIT License All Contributors

PRs Welcome Code of Conduct Roadmap

The problem

You're writing tests and need to come up with the name of your user stub. Why waste time hard-coding 'John Doe' again when you could use 'Count Dooku' or 'Qui-Gon Jinn'? Using characters makes your tests much more interesting.

This solution

This module has ~100 character names and exposes an API for you to get a random one every time you call it.

Installation

This module is distributed via [npm][npm] which is bundled with [node][node] and should be installed as one of your project's dependencies:

npm install --save typescript-utility

Alternatively you can get the UMD build which is also published to the npm registry and is therefore available via unpkg.com:

The UMD build exposes the module as a global called typescriptUtility or as an unnamed module for AMD/CommonJS (require it by its file path)

Usage

const typescriptUtility = require('typescript-utility') // CommonJS
console.log(typescriptUtility.random()) // Han Solo
console.log(typescriptUtility.random()) // Kit Fisto
// you can also get the full array on `typescriptUtility.all`

LICENSE

MIT