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

double-delta-stream

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

double-delta-stream

calculate double-delta for incoming data

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

double-delta-stream

Calculate double-delta for incoming data. Useful for compressing time-series data.

npm i double-delta-stream

Usage

var dd = require('double-delta-stream')
var collect = require('collect-stream')

var s = dd(
  function (x) { return parseInt(x, 10) }, // how to parse incoming data
  function (a, b) { return b - a } // how to calculate delta between data
)

// create a source stream
var source = new Readable()
source.push('0')
source.push('100')
source.push('201')
source.push('299')
source.push('400')
source.push(null)

// pipe into dd
source.pipe(s)

collect(s, function (err, data) {
  // data == [{header: 0}, {d0: 100}, {d1: 1}, {d1: -2}, {d1: 1}])
})

License

The MIT License

Keywords

FAQs

Package last updated on 24 Jan 2017

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