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

median-stream

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

median-stream

median-stream is a stream that takes an input of integers and pipes out the median of those integers

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

median-stream

median-stream is a stream that takes an input of integers and pipes out the median of those integers.

If you pipe in 1 2 3 4 5, then it will only output 3.

However if you pipe 1 2 3 4 5, then it will output 1, 1.5, 2, 2.5, 3.

example

example.js

'use strict';

import MedianStream from 'median-stream'

let medianStream = new MedianStream()
medianStream.on('error', function(err) { console.log('Error:', err.stack) })
process.stdin.pipe(medianStream).pipe(process.stdout)

terminal

echo 1 2 3 4 5 | node example.js

license

ISC

author

Shuan Wang (shuanwang@gmail.com)

FAQs

Package last updated on 17 Feb 2016

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