Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4 from rvagg/patch-1

syntax highlighting on readme
  • Loading branch information...
commit 3d379e297fc2e6353ce632c0db16f2775f15da38 2 parents 402f62d + 3c7b472
@maxogden authored
Showing with 26 additions and 18 deletions.
  1. +26 −18 readme.md
View
44 readme.md
@@ -1,31 +1,39 @@
# concat-stream
- npm install concat-stream
+```sh
+$ npm install concat-stream
+```
then
- var concat = require('concat-stream')
- var fs = require('fs')
+```js
+var concat = require('concat-stream')
+var fs = require('fs')
- var read = fs.createReadStream('readme.md')
- var write = concat(function(err, data) {})
-
- read.pipe(write)
+var read = fs.createReadStream('readme.md')
+var write = concat(function(err, data) {})
+read.pipe(write)
+```
+
works with arrays too!
- var write = concat(function(err, data) {})
- write.write([1,2,3])
- write.write([4,5,6])
- write.end()
- // data will be [1,2,3,4,5,6] in the above callback
+```js
+var write = concat(function(err, data) {})
+write.write([1,2,3])
+write.write([4,5,6])
+write.end()
+// data will be [1,2,3,4,5,6] in the above callback
+```
works with buffers too! can't believe the deals!
- var write = concat(function(err, data) {})
- write.write(new Buffer('hello '))
- write.write(new Buffer('world'))
- write.end()
- // data will be a buffer that toString()s to 'hello world' in the above callback
-
+```js
+var write = concat(function(err, data) {})
+write.write(new Buffer('hello '))
+write.write(new Buffer('world'))
+write.end()
+// data will be a buffer that toString()s to 'hello world' in the above callback
+```
+
MIT LICENSE
Please sign in to comment.
Something went wrong with that request. Please try again.