• Stars
    star
    474
  • Rank 92,640 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 11 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Explore Node.js streams with an interactive playground.

Node.js Stream Playground

Explore Node.js streams with an interactive playground.

node-stream-playground

The Node.js Stream Playground was created to help Node.js developers better understand how streams work by showing a number of use cases that are easily plug-and-play-able. Additionally detailed logging is provided at every step to help users better understand what events the streams are emitting and exactly what their contents are.

Adding in New Streams

If you're interested in extending the playground and adding in new pluggable "blocks" you can simply edit blocks.js and add in the stream functions. A common stream block would look something like this:

"Change Encoding": function(from /* EUC-JP */, to /* UTF-8 */) {
    var Iconv = require("iconv").Iconv;
    return new Iconv(from, to);
},

The property name is the full title/description of the stream. The arguments to the function are variables that you wish the user to populate. The comments immediately following the argument names are the default values (you can provide multiple values by separating them with a |).

The streams are split into 3 types: "Readable", "Writable", "Transform" (in that they read content, modify it, and pass it through). Typically it is assumed that "Readable" streams will be the first ones that you can choose in the playground, "Writeable" streams will end the playground, and everything else is just ".pipe()able".

If you've added a new stream please send a pull request and I'll be happy to add it!

Running Your Own Server

Be sure to run npm install to install all the dependencies. You can then use just node app.js to run a server - or if you wish to run something more robust you can install naught and run npm start.

WARNING I have no idea how robust the application's security is. This application is generating and executing code on the user's behalf (although it is not allowing arbitrary code to be executed). Feel free to run it on a local server or, if you feel confident in the code, run it on your own server. At the moment I'm running it on a standalone server with nothing else on it, just in case.

Inspiration and Credits

This project was created by John Resig. The code is released under an MIT license.

The project was originally created for, and demoed at, the inaugural Brooklyn.js meetup.

This project was heavily inspired by the amazing stream-adventure project and the stream-handbook. You should explore both of those resources if you wish to learn more about Node streams.

More Repositories

1

trie-js

A simple Trie implementation for Node.js.
JavaScript
258
star
2

env-js

A pure-JavaScript browser environment.
JavaScript
224
star
3

fireunit

A Firebug extension for JavaScript testing.
JavaScript
223
star
4

pulley

Easy Github Pull Request Lander
JavaScript
175
star
5

dromaeo

JavaScript Performance Test Suite
HTML
76
star
6

retweet

A simple retweet button.
JavaScript
72
star
7

nodelist

A new DOM NodeList proposal.
HTML
66
star
8

stack-scraper

HTML
62
star
9

node-romaji-name

Normalize and fix common issues with Romaji-based Japanese names.
JavaScript
40
star
10

jquery-workshop

The code behind a workshop for learning about jQuery.
JavaScript
39
star
11

pharos-images

PHAROS Image Database
JavaScript
38
star
12

idyll

Mobile, offline, crowd-sourcing app.
JavaScript
36
star
13

deepleap

JavaScript
34
star
14

elasticsearch-orm

An ORM, like Mongoose, for Elasticsearch.
JavaScript
34
star
15

ukiyoe-web

A rewrite of the Ukiyo-e.org website.
JavaScript
32
star
16

node-yearrange

Node module for converting year range strings into usable dates.
JavaScript
21
star
17

node-matchengine

Node module for using the TinEye MatchEngine API.
JavaScript
18
star
18

vote

Reddit, Hacker News, Digg voting script for Ubiquity.
JavaScript
16
star
19

ukiyoe-scrapers

Museum/database scrapers for Ukiyo-e.org
JavaScript
15
star
20

node-pastec

Node module for using a Pastec server.
JavaScript
15
star
21

node-enamdict

Efficiently query ENAMDICT using Node.js.
JavaScript
13
star
22

ukiyoe-models

Schemas for the jeresig/ukiyoe-web and jeresig/ukiyoe-scrape projects.
JavaScript
13
star
23

jquery-imgscrubber

The dynamic image scrubber from Ukiyo-e.org.
JavaScript
13
star
24

selectortest

A test suite for the Selectors API specification.
13
star
25

matchengine-tools

Tools for interacting with TinEye's MatchEngine service.
JavaScript
12
star
26

modbot

A Reddit moderation bot.
JavaScript
11
star
27

gittip-code

A simple web app for tipping Github repos and NPM modules with Gittip.
JavaScript
10
star
28

wtpa-bot

An IRC bot for managing events.
Perl
10
star
29

jeresig.github.com

A GitHub-powered web site.
7
star
30

god-game

For Art Hack Day!
JavaScript
7
star
31

twitter-timeline-cache

Archive your Twitter home timeline (posts by others).
JavaScript
7
star
32

visual-artwork-cluster

Using Pastec to visually cluster similar artworks for easy cataloging.
JavaScript
6
star
33

node-appcache-glob

Node.js Appcache Builder
JavaScript
6
star
34

node-parse-dimensions

Parse physical object dimensions and convert them into a standardized form.
JavaScript
6
star
35

playscrape

TypeScript
6
star
36

nyt-crossword

An archive of The New York Times crossword clues and answers from October 1996 through to the end of 2011
5
star
37

begin-app

Begin app
JavaScript
5
star
38

matchengine-data-analysis

Tools for analyzing data from TinEye's MatchEngine service.
JavaScript
5
star
39

science-game

JavaScript
5
star
40

datacook

Perl
4
star
41

image-report

JavaScript
4
star
42

ig-snag

Snag a bunch of images from an instagram tag.
JavaScript
4
star
43

begin-functions-app

Begin app
JavaScript
3
star
44

parse-catalogue

JavaScript
2
star
45

node-bulk-replace

JavaScript
2
star
46

ukiyoe-colors

JavaScript
2
star
47

apples2artworks

Python
1
star
48

nypl-ukiyoe

Python
1
star
49

johnresig.com-wp-theme

PHP
1
star
50

node-ndlna

Node module for searching the NDL Name Authority.
JavaScript
1
star