The backbone of a scaffolding tool.
$ cnpm install kopy

The backbone of a scaffolding tool.
yarn add kopy
const kopy = require('kopy')
const config = {
prompts() {
return [
{
type: 'input',
name: 'name',
message: 'what is your name'
}
]
},
actions() {
return [
{
type: 'copy',
files: '**',
cwd: '/path/to/templates',
// When specified, transform the files with `ejs`
data: this.answers
}
]
},
completed() {
console.log('Done!')
}
}
const generator = kopy(config)
generator
.run({
outDir: './out'
})
.catch(kopy.handleError)
Testing:
const kopy = require('kopy')
test('it works', async () => {
const generator = kopy(config)
await generator.emulate()
expect(generator.answers).toEqual({ name: '' })
})
Read more docs on our website.
git checkout -b my-new-featuregit commit -am 'Add some feature'git push origin my-new-featurekopy © EGOIST, Released under the MIT License.
Authored and maintained by EGOIST with help from contributors (list).
Website · GitHub @EGOIST · Twitter @_egoistlily
Copyright 2013 - present © cnpmjs.org | Home |