0.5.0 • Published 11 months ago

fixtures-generator-node v0.5.0

Weekly downloads
5
License
MIT
Repository
github
Last release
11 months ago

fixtures-generator-node

Generates random fixtures easily.

Examples :

const r = require('fixtures-generator-node')

const users = r.utils.array(25, i => ({
  id: r.mem.keep(i+1, 'userId'),
  email: r.profile.email(),
  password: 'user'+(i+1),
  avatar: r.images.avatarUrl(),
  biography: r.lorem.words(),
  createdAt: r.dates.timestamp(),
  updatedAt: r.dates.after(),
}))

const posts = r.utils.array(r.numbers.int({min:15,max:30}), i => ({
  id: i+1,
  userId: r.mem.one('userId'),
  title: r.lorem.words(),
  content: r.lorem.paragraphs({min:5,max:12,nl:'<br>'}),
  published: r.numbers.bool(0.75),
  createdAt: r.dates.timestamp(),
  updatedAt: r.dates.after(),
}))
0.5.0

11 months ago

0.4.0

2 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

7 years ago