

The backbone of a scaffolding tool.
Features
- Zero-dependency, very light-weight (980KB) compared to Yeoman (12MB)
- Ultra-simple, this module exists because writing Yeoman generator is hard and time-consuming
Install
yarn add kopy
Usage
const kopy = require('kopy')
const config = {
prompts() {
return [
{
type: 'text',
name: 'name',
message: 'what is your name'
}
]
},
actions() {
return [
{
type: 'copy',
files: '**',
cwd: '/path/to/templates',
data: this.answers
}
]
},
completed() {
console.log('Done!')
}
}
const generator = kopy(config)
generator
.run({
outDir: './out'
})
.catch(generator.handleError)
Testing:
const kopy = require('kopy')
test('it works', async () => {
const generator = kopy(config)
const result = await generator.test({
name: 'kevin'
})
expect(result.fileList).toContain('index.js')
})
Read more docs on our website.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
kopy © EGOIST, Released under the MIT License.
Authored and maintained by EGOIST with help from contributors (list).
Website · GitHub @EGOIST · Twitter @_egoistlily