# node-inout

> A simple terminal input and output via stdin and stdout using event emitters as transport for the data

Latest version **1.0.3** (published 2016-10-31) · SEE LICENCE IN LISENCE license · 0 weekly downloads

## Install

```sh
npm install node-inout
pnpm add node-inout
yarn add node-inout
bun add node-inout
```

## 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.0.3 |
| Published | 2016-10-31 |
| First published | 2016-10-31 |
| Weekly downloads | 0 |
| License | SEE LICENCE IN LISENCE |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | claytonbez |
| Maintainers | claytonbez |
| Keywords | sdtin, sdtout, event, emit |

## Links

- npm: https://www.npmjs.com/package/node-inout
- Repository: https://github.com/claytonbez/node-inout
- Homepage: https://github.com/claytonbez/node-inout#readme
- Issues: https://github.com/claytonbez/node-inout/issues
- npm.io page: https://npm.io/package/node-inout

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2016-10-31
- 1.0.2 — 2016-10-31
- 1.0.1 — 2016-10-31

## README

# node-inout
A simple terminal input and output via stdin and stdout using event emitters as transport for the data
##Install
```
npm install node-inout
```
## Setup
```javascript
var terminal = require('./node-inout.js'); // If placed in same directory as script you want to use it in
```
## Setup Async Reading 
Currently only type available
```javascript
var reader = new terminal(); //Initiates readline module and emits event on receipt of a line
```
##Listen for 'In' event
<p>structure : object.on('in',function(callback){}); </p>
```javascript
reader.on('in',function(data){
  console.log("stdin-> " + data) ; //Here you can do pretty much anything with the received input
});
```
##Send data to the terminal (stdout)
structure : object.emit('out',data,newline) ; 
```javascript
//If you want to send and go to the next line use
  reader.emit('out,'Hello World!,true); 
//If you want to send only and not go to a new line
  reader.emit('out','Hello World',false) ; 
    //or the newline argument can be omitted. 
  reader.emit('out','Hello World') ; 
```
That's it! Now you have an event based console/terminal input and output. 

####Depedencies
Uses nodejs native 'events' and 'process' modules

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