# o-yi

> express generator

Latest version **0.2.2** (published 2017-02-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install o-yi
pnpm add o-yi
yarn add o-yi
bun add o-yi
```

Provides the command `o-yi`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2017-02-27 |
| First published | 2016-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | vivalalova |
| Maintainers | karolass, lova |
| Keywords | express |

## Links

- npm: https://www.npmjs.com/package/o-yi
- Repository: https://github.com/vivalalova/o-yi
- Homepage: https://github.com/vivalalova/o-yi#readme
- Issues: https://github.com/vivalalova/o-yi/issues
- npm.io page: https://npm.io/package/o-yi

## Dependencies (2)

- [fs-extra](https://npm.io/package/fs-extra.md) ^2.0.0
- [commander](https://npm.io/package/commander.md) ^2.9.0

## Recent versions

- 0.2.2 (latest) — 2017-02-27
- 0.2.1 — 2017-02-23
- 0.2.0 — 2017-02-23
- 0.1.14 — 2017-02-11
- 0.1.13 — 2017-01-08
- 0.1.12 — 2017-01-08
- 0.1.11 — 2016-08-27
- 0.1.10 — 2016-08-27
- 0.1.9 — 2016-07-18
- 0.1.8 — 2016-07-18
- 0.1.7 — 2016-07-18
- 0.1.6 — 2016-07-18
- 0.1.5 — 2016-07-17
- 0.1.4 — 2016-07-17
- 0.1.3 — 2016-07-17
- … 2 more at https://npm.io/package/o-yi/versions

## README

# o-yi

A express generator

##### Master

[![Build Status](https://travis-ci.org/vivalalova/o-yi.svg?branch=master)](https://travis-ci.org/vivalalova/o-yi/)

##### Develop
[![Build Status](https://travis-ci.org/vivalalova/o-yi.svg?branch=develop)](https://travis-ci.org/vivalalova/o-yi/)

## Notice

1. o-yi 0.2.0+ for node 7.6+.

2. [o-yi 0.1.x](https://github.com/vivalalova/o-yi/tree/node4) for node 4 +

## Installation

```bash
npm install -g o-yi
```

## GET STARTED

#### Create project

```bash
o-yi new {project name}
```

#### Enter {project name} folder

```bash
cd {project name}
```

#### Generate a CRUD API

```bash
o-yi generate {api name}
```

#### Add route in `api/config/route.js` just like

```javascript
const user = require('../controller/user.js')

module.exports = [{
    user: [
        ['get', '/', user.find],
        ['get', '/:id', user.findOne],
        ['post', '/', user.create],
        ['put', '/:id', user.update],
        ['delete', '/:id', user.delete],
    ]
}]
```

### Before Action

```javascript
module.exports = [{
    user: [
        //verify before api
        ['get', '/', user.findOne, jwt.verify],
        //API handler
        ['get', '/:id', user.findOne],
        ['post', '/', user.create],
        ['put', '/:id', user.update],
        ['delete', '/:id', user.delete],
    ]
}]
```

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