Browse files

Added the README.

Whoops.

Signed-off-by: Tim Smart <tim@fostle.com>
  • Loading branch information...
1 parent ff99dbf commit 0dbfc0730491c32f1666ea65effde0a37281cb70 @tim-smart committed Jun 10, 2012
Showing with 39 additions and 0 deletions.
  1. +39 −0 README
View
39 README
@@ -0,0 +1,39 @@
+node-multipart
+==============
+
+A simple multipart message creation utility for Node.js, that has a nice stream-like interface.
+
+
+Install
+-------
+
+ npm install multipart
+
+
+Usage
+-----
+
+For a brief introduction to the api, take a look at test/simple.js. Otherwise:
+
+ var multipart = require('multipart')
+
+ // Create the stream object using the provided factory.
+ var my_mp_stream = multipart.createMultipartStream()
+
+ // Pipe the multipart message to stdout.
+ my_mp_stream.pipe(process.stdout)
+
+ // Write some stuff to the multipart stream. Take a look in test/ and index.js
+ // for more options and gimmicks.
+ my_mp_stream.write(
+ { 'Content-Disposition' : 'form-data; name="files"'
+ , 'Content-Type' : another_mp_stream.contentType(my_mp_stream)
+ }
+ , another_mp_stream
+ , function () {
+ console.log('FILESWRITTEN')
+ }
+ )
+
+ // Tie up the loose ends.
+ my_mp_stream.end(end_cb_fn)

0 comments on commit 0dbfc07

Please sign in to comment.