# kopy

> The backbone of a scaffolding tool.

Latest version **9.4.2** (published 2019-01-09) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install kopy
pnpm add kopy
yarn add kopy
bun add kopy
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 9.4.2 |
| Published | 2019-01-09 |
| First published | 2016-12-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 965.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 38 |
| Author | egoist |
| Maintainers | egoist, rem |

## Links

- npm: https://www.npmjs.com/package/kopy
- Repository: https://github.com/saojs/kopy
- Homepage: https://github.com/saojs/kopy#readme
- Issues: https://github.com/saojs/kopy/issues
- npm.io page: https://npm.io/package/kopy

## Recent versions

- 9.4.2 (latest) — 2019-01-09
- 9.4.1 — 2019-01-09
- 9.4.0 — 2019-01-09
- 9.3.0 — 2019-01-09
- 9.2.1 — 2019-01-07
- 9.2.0 — 2019-01-06
- 9.1.0 — 2019-01-06
- 9.0.0 — 2019-01-06
- 8.3.1 — 2018-08-03
- 8.3.0 — 2018-02-14
- 8.2.5 — 2017-12-31
- 8.2.4 — 2017-12-16
- 8.2.3 — 2017-09-12
- 8.2.2 — 2017-09-09
- 8.2.1 — 2017-09-03
- … 29 more at https://npm.io/package/kopy/versions

## README

<br><br><br><br><br><br><br>

![kopy 1](https://user-images.githubusercontent.com/8784712/50736257-172d9100-11f6-11e9-9408-36bbceab2011.png)

<br><br><br><br><br><br><br>

[![NPM version](https://badgen.net/npm/v/kopy)](https://npmjs.com/package/kopy) [![NPM downloads](https://badgen.net/npm/dm/kopy)](https://npmjs.com/package/kopy) [![CircleCI](https://badgen.net/circleci/github/saojs/kopy/master)](https://circleci.com/gh/saojs/kopy/tree/master) [![package size](https://badgen.net/packagephobia/install/kopy)](https://packagephobia.now.sh/result?p=kopy) [![donate](https://badgen.net/badge/support%20me/donate/ff69b4)](https://patreon.com/egoist) [![chat](https://badgen.net/badge/chat%20on/discord/7289DA)](https://chat.egoist.moe)

---

**The backbone of a scaffolding tool.**

## Features

- Zero-dependency, very light-weight (940KB) compared to [Yeoman](https://packagephobia.now.sh/result?p=yeoman-generator) (12MB)
- Ultra-simple, this module exists because writing Yeoman generator is hard and time-consuming

## Install

```bash
yarn add kopy
```

## Usage

```js
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:

```js
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](https://kopy.saojs.org).**

## 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) License.<br>
Authored and maintained by EGOIST with help from contributors ([list](https://github.com/saojs/kopy/contributors)).

> [Website](https://egoist.sh) · GitHub [@EGOIST](https://github.com/egoist) · Twitter [@\_egoistlily](https://twitter.com/_egoistlily)

---
_Source: https://npm.io/package/kopy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
