Skip to content

fijimunkii/number-spigot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js Number Spigot

Streaming number generator for e π and primes using spigot algorithms

Node.js streams handle backpressure

Pipe a number spigot and stream numbers

Example:

  • run as cli
node lib/prime
  • pipe with bash
node lib/pi | less 
node lib/prime > primes.txt
  • pipe into your node app
const EulerSpigot = require('number-spigot').e;
const spigot = new EulerSpigot();
spigot
  .pipe(myTransform)
  .pipe(process.stdout);

For more complete examples, look into the examples folder

About

Streaming number generator for e, π, and primes

Resources

Stars

Watchers

Forks

Packages

No packages published