typescript-utility
v1.0.5
Published
just sample library for custom typescript utility
Downloads
6
Readme
typescript-utility
Get random character names
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:
- https://unpkg.com/[email protected]/dist/index.umd.js
- https://unpkg.com/[email protected]/dist/index.umd.min.js
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