Pon task to generate data seed
$ npm install pon-task-seed --save
'use strict'
const pon = require('pon')
const ponTaskSeed = require('pon-task-seed')
async function tryExample () {
let db = () => require('../db')
let run = pon({
'db:seed': ponTaskSeed(db, 'db/seeds/:env/*.js')
})
run('db:seed')
}
tryExample()
Define task
Param | type | Description |
---|---|---|
db | function|ClayLump | DB instance or it's creator |
pattern | string | Filename pattern |
options | Object | Optional settings |
options.env | string | Env to resolve |
options.resolver | function | Resolver for resource name |
This software is released under the Apache-2.0 License.