# lightco

> lightco use generator

Latest version **0.1.9** (published 2019-02-12) · MIT license · 0 weekly downloads

## Install

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

## 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.1.9 |
| Published | 2019-02-12 |
| First published | 2016-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | wd |
| Maintainers | sbnode |
| Keywords | lightco, co, generator |

## Links

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

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads
- [datasets-fi-postalcodes](https://npm.io/package/datasets-fi-postalcodes.md) — 1.1K weekly downloads

## Recent versions

- 0.1.9 (latest) — 2019-02-12
- 0.1.7 — 2016-07-22
- 0.1.6 — 2016-07-18
- 0.1.5 — 2016-07-16
- 0.1.4 — 2016-07-16
- 0.1.3 — 2016-07-15
- 0.1.2 — 2016-07-13
- 0.1.1 — 2016-07-13
- 0.1.0 — 2016-07-13

## README

# lightco


#### this package is my for learning npm and nodejs, pull request is welcome


useage:
node with optional --harmony_destructuring
```js

var fs = require('fs')
var request = require('request')
var lightco = require('lightco')

lightco.run(function* ($) {
    var [error, data] = yield fs.readFile('index.js', 'utf8', $)
    if (error)
        throw error
    console.log(data)

    var [error, response, body] = yield request('http://www.baidu.com', $)
    if (error)
        throw error
    console.log(response.statusCode)

    var [error, data] = yield query(true)
    if (error)
        throw error
    console.log(data)
})
```

#### 0.1.6 support promise
when onRejected was invoked, the first argument error must be a Error

when onFulfilled was invoked, the first argument must be a null, the second argument must be a data

#### 0.1.7 fix a bug (Generator is already running)
```js
var immediatelyInvoke = function(cb) {
	cb('hi!')
}
// this will be generate a error (Generator is already running)
```


#### Unit testing test/test.js

## License

  MIT

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