9.4.2 • Published 5 years ago

kopy v9.4.2

Weekly downloads
5,625
License
MIT
Repository
github
Last release
5 years ago

kopy 1

NPM version NPM downloads CircleCI package size donate chat


The backbone of a scaffolding tool.

Features

  • Zero-dependency, very light-weight (940KB) 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: '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.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. 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

9.4.2

5 years ago

9.4.1

5 years ago

9.4.0

5 years ago

9.3.0

5 years ago

9.2.1

5 years ago

9.2.0

5 years ago

9.1.0

5 years ago

9.0.0

5 years ago

8.3.1

6 years ago

8.3.0

6 years ago

8.2.5

6 years ago

8.2.4

6 years ago

8.2.3

7 years ago

8.2.2

7 years ago

8.2.1

7 years ago

8.2.0

7 years ago

8.1.0

7 years ago

8.0.1

7 years ago

8.0.0

7 years ago

7.1.0

7 years ago

7.0.3

7 years ago

7.0.2

7 years ago

7.0.1

7 years ago

7.0.0

7 years ago

6.1.0

7 years ago

6.0.0

7 years ago

5.1.1

7 years ago

5.1.0

7 years ago

5.0.5

7 years ago

5.0.4

7 years ago

5.0.3

7 years ago

5.0.2

7 years ago

5.0.1

7 years ago

5.0.0

7 years ago

4.1.0

7 years ago

4.0.0

7 years ago

3.0.0

7 years ago

2.4.0

7 years ago

2.3.0

7 years ago

2.2.0

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago