Need private packages and team management tools?Check out npm Teams »

pudding

4.0.4 • Public • Published

pudding

Build Status Code Climate Code Coverage npm Version JS Standard

Generate test data with random embed values.

Installation

npm install pudding --save-dev

Usage

#!/usr/bin/env node
'use strict'
 
const pudding = require('pudding')
 
// Create a new pudding instance.
let p = pudding({
  lang: 'ja',
  vars: {}
})
 
// Explode meta expressions
let testData = p.explode({
  userName: '${this.namae} ${this.myouji}',
  age: '${10 + i * 3}'
}, 3)
 
console.log('testData=' + JSON.stringify(testData, null, 4))
 

will result:

testData = [
  { userName: '結衣 根本', age: '10' },
  { userName: '隆太 井原', age: '13' },
  { userName: '圭 柳', age: '16' }
]
 

Avilable expressions are defined in pudding-datasource

License

This software is released under the MIT License.

Links

Install

npm i pudding

DownloadsWeekly Downloads

31

Version

4.0.4

License

MIT

Last publish

Collaborators

  • avatar