Skip to content

realglobe-Inc/pon-task-seed

Repository files navigation

pon-task-seed

Build Status npm Version JS Standard

Pon task to generate data seed

Installation

$ npm install pon-task-seed --save

Usage

'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()

Signatures

define(db, pattern, options) -> function

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

License

This software is released under the Apache-2.0 License.

Links