loopback-faker-mixin
Synopsis
A mixin for loopback using the faker library.
Code Example
In your model.json
"name": "Customer" "base": "User" "properties": "name": "type": "string" faker: 'faker.method' || method: 'faker.method' args: 'arg1' see https://github.com/marak/Faker.js/ "mixins": "Faker": "email": "internet.email" "password": "internet.password"
After the app has initialised you are able to access the static faker method via
let Customer = appmodels Customer Customer
Motivation
A simple way to create random data for testing and seeding
Installation
npm install faker loopback-faker-mixin
=============
Add the mixins
property to your server/model-config.json
:
API Reference
Contributors
Henry Stevens |