Skip to main content

fake-gen

NPM code style: prettier Build Status NPM downloads Coverage Status deno doc semantic-release

About

Faker data generator, progressive refactor from faker

Install

npm install --save fake-gen

Or

yarn add fake-gen

Deno import

// @deno-types="https://raw.githubusercontent.com/roggervalf/fake_gen/master/dist/main.d.ts"
import { Random } from 'https://raw.githubusercontent.com/roggervalf/fake_gen/master/dist/main.es.js';

or

// @deno-types="https://deno.land/x/fake_gen@master/dist/main.d.ts"
import { Random } from 'https://deno.land/x/fake_gen@master/dist/main.es.js';

Node import

import { Random } from 'fake-gen';

Example:

const { Random } = require('fake-gen');

const random = new Random();

console.log(random.number(100));
// expects a random number from 0 to 100

console.log(random.uuid());
// expects a random uuid, i.e: 49e71c40-9b21-4371-9699-2def33f62e66

random.initSeed(100);
console.log(random.number(100));
// expects a 54

Methods

  • random
    • number
    • float
    • arrayElement
    • uuid
    • boolean

Article

How to build a Deno module

Contributing

Fork the repo, make some changes, submit a pull-request! Here is the contributing doc that has some details.

License

MIT © roggervalf