New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

most-buffer

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

most-buffer

Gather most.js streams events into buffers

latest
Source
npmnpm
Version
0.0.11
Version published
Maintainers
1
Created
Source

most-buffer

Version License

Gather most js streams events into buffers. Buffers are emitted according to a given event count or gather the complete stream if no count is given.

Installation

Using npm:

$ npm install --save most-buffer

In Node.js:

const buffer = require('most-buffer');

Usage

stream.thru(buffer(count)) -> Stream

stream:                 -a--b--c--------d--e--|
stream.thru(buffer(3)): -------[a,b,c]--------[d,e]|
  • count is the size of the buffer, if undefined the full stream will be buffered before being emitted as an array.

Examples

const most = require('most');
const buffer = require('most-buffer');

// Logs
// [1, 2, 3, 4]
// [5, 6, 7, 8]
// [9]
most.iterate(x => x + 1, 0)
  .take(9) // 9 first numbers
  .thru(buffer(4)) // In buffer of 4 or less
  .observe(x => console.log(x))
// Logs
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
most.iterate(x => x + 1, 0)
  .take(9) // 9 first numbers
  .thru(buffer()) // Buffer the complete stream
  .observe(x => console.log(x))

Keywords

most-utils

FAQs

Package last updated on 03 Apr 2018

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