# gen-io

> generator wrapper of async io

Latest version **1.2.2** (published 2015-12-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install gen-io
pnpm add gen-io
yarn add gen-io
bun add gen-io
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2015-12-25 |
| First published | 2015-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | michaelbag |
| Maintainers | mikailbag |
| Keywords | io, generators |

## Links

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

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^2.2.0
- [lodash](https://npm.io/package/lodash.md) ^3.10.1

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.2.2 (latest) — 2015-12-25
- 1.2.1 — 2015-12-18
- 1.2.0 — 2015-11-20
- 1.1.2 — 2015-11-16
- 1.1.1 — 2015-11-13
- 1.1.0 — 2015-11-13
- 1.0.0 — 2015-11-13

## README

# gen-fs
[![Build Status](https://api.travis-ci.org/MikailBag/gen-io.svg)](https://travis-ci.org/MikailBag/gen-io)

[![NPM](https://nodei.co/npm/gen-io.png?downloads=true)](https://nodei.co/npm/gen-io/)

Provides async io in generator wrapper.
you can see example in [example/base.js](https://github.com/MikailBag/gen-io/blob/master/example/base.js)

## examples
just writes google port to file.
```javascript
    let genio=require('gen-io');
    genio(function*(io){
        let ports=yield io.dns.resolve('google.com','A');
        let fd=yield io.fs.open('./ports.txt');
        io.fs,write(fd,ports.toString())
    });
    
```

"sync" TCP server
```javascript
    let server=require('net').createServer()
    let genio=require('gen-io');
    genio(function*(io){
        while(true){
            var socket=yield io.util.wait(server,'connection');
           //echo
           socket.pipe(socket);
        
 
        
        }
    });
    server.listen(8124)

```

## Troubleshooting
goes [here](https://github.com/MikailBag/gen-io/issues/new)

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