# stream-slic3r

> A nodejs stream slicer that emits data in slice units.

Latest version **1.0.1** (published 2020-08-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install stream-slic3r
pnpm add stream-slic3r
yarn add stream-slic3r
bun add stream-slic3r
```

## 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.1 |
| Published | 2020-08-26 |
| First published | 2020-08-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | g00dnatur3 |

## Links

- npm: https://www.npmjs.com/package/stream-slic3r
- Repository: https://github.com/g00dnatur3/stream-slicer
- Homepage: https://github.com/g00dnatur3/stream-slicer#readme
- Issues: https://github.com/g00dnatur3/stream-slicer/issues
- npm.io page: https://npm.io/package/stream-slic3r

## Recent versions

- 1.0.1 (latest) — 2020-08-26
- 1.0.0 — 2020-08-24

## README

# stream-slic3r

A nodejs stream slicer that emits data in sliced units.

much faster than https://github.com/samcday/node-stream-splitter

# example code from test.js

```
const StreamSlicer = require('stream-slic3r');
const assert = require('assert');

// example string slicer

var test = 'happyFIRST_CHUNKhappySECOND_CHUNKhappyTHIRD_CHUNKhappyFOURTH_CHUNKhappyFIFTH_CHUNK';
const stringSlicer = new StreamSlicer('happy');

stringSlicer.on('data', function(data) {
  assert(data.toString().indexOf('happy') == 0);
  console.log(data.toString());
})

stringSlicer.end(test);

// example nal unit slicer

const fs = require('fs');
const nalSlicer = new StreamSlicer([0,0,0,1]);
const h264Stream = fs.createReadStream('./sample.h264');

h264Stream.pipe(nalSlicer);

nalSlicer.on('data', function(data) {
  assert(data.toString('hex').substring(0, 8) === '00000001');
})

```

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