pudding
v4.0.4
Published
Generate test data with random embed values.
Downloads
45
Readme
pudding
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.