0.2.3 • Published 6 years ago

mockachino v0.2.3

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Mockachino logo

  • Faker
  • Mocker
  • Mocha?
  • Mochachino?!

Mockachino

Generate mock data for your apps, take a sip and relax!

* People
* Addresses
* Phone Numbers
* Jobs
* Sentences
* Paragraphs
* Texts
* Cities
* & more

Based on US data; other countries to come.

Documentation

How to use

Script tag

<script src="mockachino.min.js"></script>
<script>
    let mocka = new Mockachino().mock();
    //show mocked data in the console
    console.log(mocka.person);
    /*
    e.g: Object { name: "Valentina", middlename: "Nevaeh", middleInitial: "N.", lastname: "Adams", initials: "V.A", email: "valentina.adams@hotmail.com", academicTitle: "Prof.", sex: "woman", age: 23, height: "4.1", … }
    */
</script>

npm

npm i --save-dev mockachino

import or require

//for import remember to transpile your code with babel
const mocka = require('Mockachino');

let mocka = new Mockachino({
    locale: 'us',
    person: {
        sex: 'man',
        height: 'tall',
        age: '20s'
    }
});

console.log(mocka.mock().person);
/*
e.g: Object { name: "Elias", middlename: "Ethan", middleInitial: "E.", lastname: "Coleman", initials: "E.C", email: "elias.coleman@hotmail.com", academicTitle: "Dr.", sex: "man", age: 25, height: "5.10", … }
*/

Options

OptionDescription
LocaleDefines the locale the data should be based on. Defaults to 'us', more locales to come
PersonMock a person, define the person sex, age, and height
Person
sexwoman, man
heighttall, short
ageyoung, old, 20s, 30s

Badges

Build Status

Shout outs

lunapic and frankie on Unsplash for the amazing editor and pic that allowed me to make the awesome logo.

jsdoc and minami for being awesome at generating awesome websites from simple comments.

makever for making creating releases on github super easy.

Author

© 2018 Simao Nziaka

Licence

The MIT License MIT