New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

stream-slic3r

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-slic3r

A nodejs stream slicer that emits data in slice units.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33
increased by43.48%
Maintainers
1
Weekly downloads
 
Created
Source

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');
})

FAQs

Package last updated on 26 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc