Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

buf and stream examples

  • Loading branch information...
commit 6f967f219f358092a15876f4796c4b004940919c 1 parent eb8bf54
@substack authored
Showing with 21 additions and 0 deletions.
  1. +12 −0 examples/buf.js
  2. +9 −0 examples/stream.js
View
12 examples/buf.js
@@ -0,0 +1,12 @@
+#!/usr/bin/env node
+
+var Put = require('put');
+var buf = Put()
+ .word16be(1337)
+ .word8(1)
+ .pad(5)
+ .put(new Buffer('pow', 'ascii'))
+ .word32le(9000)
+ .buffer()
+;
+console.log(buf);
View
9 examples/stream.js
@@ -0,0 +1,9 @@
+#!/usr/bin/env node
+
+var Put = require('put');
+Put()
+ .word16be(24930)
+ .word32le(1717920867)
+ .word8(103)
+ .write(process.stdout)
+;
Please sign in to comment.
Something went wrong with that request. Please try again.