# nv-facutil-stream

> nv-facutil-stream ================== - nv-facutil-stream is a simple-wrap of some stream Class - provide cache

Latest version **1.0.11** (published 2021-08-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install nv-facutil-stream
pnpm add nv-facutil-stream
yarn add nv-facutil-stream
bun add nv-facutil-stream
```

## 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.11 |
| Published | 2021-08-16 |
| First published | 2021-02-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ihgazni2 |

## Links

- npm: https://www.npmjs.com/package/nv-facutil-stream
- npm.io page: https://npm.io/package/nv-facutil-stream

## Dependencies (1)

- [nv-facutil-promise](https://npm.io/package/nv-facutil-promise.md) ^1.0.13

## Recent versions

- 1.0.11 (latest) — 2021-08-16
- 1.0.10 — 2021-08-15
- 1.0.9 — 2021-08-15
- 1.0.8 — 2021-08-15
- 1.0.7 — 2021-08-15
- 1.0.6 — 2021-08-14
- 1.0.5 — 2021-08-10
- 1.0.4 — 2021-08-10
- 1.0.3 — 2021-08-09
- 1.0.2 — 2021-08-07
- 1.0.1 — 2021-08-06
- 1.0.0 — 2021-02-19

## README

nv-facutil-stream
==================
- nv-facutil-stream  is a simple-wrap of some stream Class
- provide cache


install
=======
- npm install nv-facutil-stream 

usage
=====
    
    const {Transform,Writable} = require("nv-facutil-stream");


example
-------



### WS

        > var {pws} = require("nv-facutil-stream")
        > var [p,ws] = pws()
        > p
        Promise { <pending> }
        > await ws.send('A')
        true
        > await ws.send('B')
        true
        > await ws.send('c')
        true
        > p
        Promise { <pending> }
        > ws.end()


        > p
        Promise { true }
        >
        > ws.writable
        false
        >





### Transfrom


    const {Transform} = require("nv-facutil-stream");

    > var trans$ = new Transform()
    undefined
    > trans$.set_ondata_handler(
    ...     (chunk) => {
    .....         console.log("data:");
    .....         console.log(chunk)
    .....     }
    ... );
    undefined
    > var my_console = new console.Console({stdout:trans$,colorMode:true});
    undefined
    >
    > var tbl = [
    ...     { a: 1, b: 2 },
    ...     { a: 3, b: 7, c: 'y' },
    ... ]
    undefined
    >
    > my_console.table(tbl)
    data:
    ┌─────────┬───┬───┬─────┐
    │ (index) │ a │ b │  c  │
    ├─────────┼───┼───┼─────┤
    │    0    │ 1 │ 2 │     │
    │    1    │ 3 │ 7 │ 'y' │
    └─────────┴───┴───┴─────┘
    
    undefined
    > trans$.cache
    <Buffer e2 94 8c e2 94 80 e2 94 80 e2 94 80 e2 94 80 e2 94 80 e2 94 80 e2 94 80 e2 94 80 e2 94 80 e2 94 ac e2 94 80 e2 94 80 e2 94 80 e2 94 ac e2 94 80 e2 94 ... 336 more bytes>
    > trans$.stringify()
    '┌─────────┬───┬───┬─────┐\n' +
      '│ (index) │ a │ b │  c  │\n' +
      '├─────────┼───┼───┼─────┤\n' +
      '│    0    │ \x1B[33m1\x1B[39m │ \x1B[33m2\x1B[39m │     │\n' +
      "│    1    │ \x1B[33m3\x1B[39m │ \x1B[33m7\x1B[39m │ \x1B[32m'y'\x1B[39m │\n" +
      '└─────────┴───┴───┴─────┘\n'
    > trans$.clear()
    undefined
    >
    > my_console.log(tbl)
    data:
    [ { a: 1, b: 2 }, { a: 3, b: 7, c: 'y' } ]
    
    undefined
    > trans$.cache
    <Buffer 5b 20 7b 20 61 3a 20 1b 5b 33 33 6d 31 1b 5b 33 39 6d 2c 20 62 3a 20 1b 5b 33 33 6d 32 1b 5b 33 39 6d 20 7d 2c 20 7b 20 61 3a 20 1b 5b 33 33 6d 33 1b ... 43 more bytes>
    > trans$.stringify()
    "[ { a: \x1B[33m1\x1B[39m, b: \x1B[33m2\x1B[39m }, { a: \x1B[33m3\x1B[39m, b: \x1B[33m7\x1B[39m, c: \x1B[32m'y'\x1B[39m } ]\n"
    > trans$.clear()
    undefined
    >



METHODS
=======

writable
--------

    w$.cache                  w$.clear
    w$.enc                    w$.shift                  w$.stringify



transform
---------

    trans$.cache                  trans$.clear                  trans$.enc
    trans$.set_ondata_handler     trans$.shift                  trans$.stringify


API
====

- fac\_stream.Writable
- fac\_stream.Transform


LICENSE
=======
- ISC

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