{"_id":"xhr-write-stream","_rev":"13-59075501f646ba0190c1c6f0dae049d9","name":"xhr-write-stream","description":"writable ordered stream of xhr requests","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.0":{"name":"xhr-write-stream","version":"0.0.0","description":"writable ordered stream of xhr requests","main":"index.js","browserify":"browser.js","directories":{"example":"example","test":"test"},"dependencies":{"ordered-emitter":"~0.1.0","concat-stream":"~0.1.0"},"repository":{"type":"git","url":"git://github.com/substack/xhr-write-stream.git"},"homepage":"https://github.com/substack/xhr-write-stream","keywords":["xhr","http","browser","ajax"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","readme":"# xhr-write-stream\n\nWrite data in the browser and receive a properly ordered stream in node from\nmultiple incoming requests.\n\nThis module only goes one way, from the browser to node. Use libraries like\n[shoe](http://github.com/substack/shoe) to create full duplex streams between\nthe browser and node.\n\n# example\n\nbrowser code:\n\n``` js\nvar xws = require('xhr-write-stream');\n\nvar ws = xws('/robots');\nws.write('beep boop');\nws.write('!!!');\nws.end();\n```\n\nserver code:\n\n``` js\nvar http = require('http');\nvar ecstatic = require('ecstatic')(__dirname + '/static');\nvar xws = require('xhr-write-stream')();\n\nvar server = http.createServer(function (req, res) {\n    if (req.url === '/robots') {\n        req.pipe(xws(function (stream) {\n            stream.pipe(process.stdout, { end : false });\n        }));\n        req.on('end', res.end.bind(res));\n    }\n    else ecstatic(req, res)\n});\nserver.listen(5000);\n```\n\nbundle up the browser code with\n[browserify](https://github.com/substack/node-browserify):\n\n```\n$ browserify browser.js -o static/bundle.js\n```\n\nthen toss down a script tag for the bundle:\n\n``` html\n<script src=\"bundle.js\"></script>\n```\n\nRun the server and visit the page in the browser:\n\n```\n$ node server.js\nbeep boop!!!\n```\n\n# browser methods\n\n``` js\nvar xws = require('xhr-write-stream')\n```\n\n## var ws = xws(path)\n\nReturn a writable stream that sends an xhr request to `path` on every `write()`.\n\nThe xhr requests are turned back into a single readable stream on the server\nside.\n\n# server methods\n\n``` js\nvar createXWS = require('xhr-write-stream')\n```\n\n## var xws = createXWS()\n\nCreate a new `xws` stream pool.\n\n## var ws = xws(cb)\n\nReturn a writable stream `ws` that you can pipe request data into from multiple\nincoming xhr requests on the browser-side.\n\n`cb(stream)` is called with a readable `stream` that aggregates data in order\nwith the data from each xhr request.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install xhr-write-stream\n```\n\nThis module makes use of\n[http-browserify](https://github.com/substack/http-browserify)\nfor the xhr-compatibility. If you just `require('xhr-write-stream')` in your\nbrowser code using [browserify](https://github.com/substack/node-browserify),\neverything will just work™.\n\n# license\n\nMIT\n","_id":"xhr-write-stream@0.0.0","dist":{"shasum":"3ef7005be36acbd656ee38c6914b12261e09d947","tarball":"https://registry.npmjs.org/xhr-write-stream/-/xhr-write-stream-0.0.0.tgz","integrity":"sha512-Dw/y9TuZ5orvlInER9aa6a2J925XzSirYE3KTo00W9v2PQWw2IvfsmYYPUmZcUdVxJGhkOqulmsgdxHK/rXaBg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfpWGhrDqWL98jtx23cdkex0x3aQjU0YaerJzqmUONtQIgEuUBynr5Tj6SGSWYfp2ZGyh7prJR0IjefmvSR1cx1xc="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"0.1.0":{"name":"xhr-write-stream","version":"0.1.0","description":"writable ordered stream of xhr requests","main":"index.js","browserify":"browser.js","directories":{"example":"example","test":"test"},"dependencies":{"ordered-emitter":"~0.1.0","concat-stream":"~0.1.0"},"repository":{"type":"git","url":"git://github.com/substack/xhr-write-stream.git"},"homepage":"https://github.com/substack/xhr-write-stream","keywords":["xhr","http","browser","ajax"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","readme":"# xhr-write-stream\n\nWrite data in the browser and receive a properly ordered stream in node from\nmultiple incoming requests.\n\nThis module only goes one way, from the browser to node. Use libraries like\n[shoe](http://github.com/substack/shoe) to create full duplex streams between\nthe browser and node.\n\n# example\n\nbrowser code:\n\n``` js\nvar xws = require('xhr-write-stream');\n\nvar ws = xws('/robots');\nws.write('beep boop');\nws.write('!!!');\nws.end();\n```\n\nserver code:\n\n``` js\nvar http = require('http');\nvar ecstatic = require('ecstatic')(__dirname + '/static');\nvar xws = require('xhr-write-stream')();\n\nvar server = http.createServer(function (req, res) {\n    if (req.url === '/robots') {\n        req.pipe(xws(function (stream) {\n            stream.pipe(process.stdout, { end : false });\n        }));\n        req.on('end', res.end.bind(res));\n    }\n    else ecstatic(req, res)\n});\nserver.listen(5000);\n```\n\nbundle up the browser code with\n[browserify](https://github.com/substack/node-browserify):\n\n```\n$ browserify browser.js -o static/bundle.js\n```\n\nthen toss down a script tag for the bundle:\n\n``` html\n<script src=\"bundle.js\"></script>\n```\n\nRun the server and visit the page in the browser:\n\n```\n$ node server.js\nbeep boop!!!\n```\n\n# browser methods\n\n``` js\nvar xws = require('xhr-write-stream')\n```\n\n## var ws = xws(path)\n\nReturn a writable stream that sends an xhr request to `path` on every `write()`.\n\nThe xhr requests are turned back into a single readable stream on the server\nside.\n\n# server methods\n\n``` js\nvar createXWS = require('xhr-write-stream')\n```\n\n## var xws = createXWS(opts={})\n\nCreate a new `xws` stream pool.\n\n`opts.timeout` is the time in milliseconds to wait for connection activity\nbefore dropping the connection and removing the stream. Default value: 60*1000\n\n## var ws = xws(cb)\n\nReturn a writable stream `ws` that you can pipe request data into from multiple\nincoming xhr requests on the browser-side.\n\n`cb(stream)` is called with a readable `stream` that aggregates data in order\nwith the data from each xhr request.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install xhr-write-stream\n```\n\nThis module makes use of\n[http-browserify](https://github.com/substack/http-browserify)\nfor the xhr-compatibility. If you just `require('xhr-write-stream')` in your\nbrowser code using [browserify](https://github.com/substack/node-browserify),\neverything will just work™.\n\n# license\n\nMIT\n","_id":"xhr-write-stream@0.1.0","dist":{"shasum":"ed2a814b5806384059d5640fca7f7d8bab36a1a2","tarball":"https://registry.npmjs.org/xhr-write-stream/-/xhr-write-stream-0.1.0.tgz","integrity":"sha512-MPxtW5bXPtyrllQQjiyRVmY4bAIvpQ/1LH7aSQubMi6TC2bMPivEcuLzarWCwP0LIl6QX3IZ1Ve0fdU6tMKwdw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBhHYdNjBBOyAaPS6VUPlj+tTmz0LQIuV1Y+BxaAHHwwIgFMv9BW7nDcw8EXoXNeohqTtXiH0WJSmqK1HoVbVoDIc="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"0.1.1":{"name":"xhr-write-stream","version":"0.1.1","description":"writable ordered stream of xhr requests","main":"index.js","browserify":"browser.js","directories":{"example":"example","test":"test"},"dependencies":{"ordered-emitter":"~0.1.0","concat-stream":"~0.1.0"},"repository":{"type":"git","url":"git://github.com/substack/xhr-write-stream.git"},"homepage":"https://github.com/substack/xhr-write-stream","keywords":["xhr","http","browser","ajax"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","readme":"# xhr-write-stream\n\nWrite data in the browser and receive a properly ordered stream in node from\nmultiple incoming requests.\n\nThis module only goes one way, from the browser to node. Use libraries like\n[shoe](http://github.com/substack/shoe) to create full duplex streams between\nthe browser and node.\n\n# example\n\nbrowser code:\n\n``` js\nvar xws = require('xhr-write-stream');\n\nvar ws = xws('/robots');\nws.write('beep boop');\nws.write('!!!');\nws.end();\n```\n\nserver code:\n\n``` js\nvar http = require('http');\nvar ecstatic = require('ecstatic')(__dirname + '/static');\nvar xws = require('xhr-write-stream')();\n\nvar server = http.createServer(function (req, res) {\n    if (req.url === '/robots') {\n        req.pipe(xws(function (stream) {\n            stream.pipe(process.stdout, { end : false });\n        }));\n        req.on('end', res.end.bind(res));\n    }\n    else ecstatic(req, res)\n});\nserver.listen(5000);\n```\n\nbundle up the browser code with\n[browserify](https://github.com/substack/node-browserify):\n\n```\n$ browserify browser.js -o static/bundle.js\n```\n\nthen toss down a script tag for the bundle:\n\n``` html\n<script src=\"bundle.js\"></script>\n```\n\nRun the server and visit the page in the browser:\n\n```\n$ node server.js\nbeep boop!!!\n```\n\n# browser methods\n\n``` js\nvar xws = require('xhr-write-stream')\n```\n\n## var ws = xws(path)\n\nReturn a writable stream that sends an xhr request to `path` on every `write()`.\n\nThe xhr requests are turned back into a single readable stream on the server\nside.\n\n# server methods\n\n``` js\nvar createXWS = require('xhr-write-stream')\n```\n\n## var xws = createXWS(opts={})\n\nCreate a new `xws` stream pool.\n\n`opts.timeout` is the time in milliseconds to wait for connection activity\nbefore dropping the connection and removing the stream. Default value: 60*1000\n\n## var ws = xws(cb)\n\nReturn a writable stream `ws` that you can pipe request data into from multiple\nincoming xhr requests on the browser-side.\n\n`cb(stream)` is called with a readable `stream` that aggregates data in order\nwith the data from each xhr request.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install xhr-write-stream\n```\n\nThis module makes use of\n[http-browserify](https://github.com/substack/http-browserify)\nfor the xhr-compatibility. If you just `require('xhr-write-stream')` in your\nbrowser code using [browserify](https://github.com/substack/node-browserify),\neverything will just work™.\n\n# license\n\nMIT\n","_id":"xhr-write-stream@0.1.1","dist":{"shasum":"b458989422f30823e33e56eeb0fdd6fd5e56758a","tarball":"https://registry.npmjs.org/xhr-write-stream/-/xhr-write-stream-0.1.1.tgz","integrity":"sha512-yjQGkp94X/HGtyWTmAifHMiNCJ24WdwNr048rJESEVl66znC/DLuK4VgdKkrD+BAOR1jBX/PyB/A9J8jn+p1rg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH70A9BEx7wm+UDuWdhmAm0+30uHHEWx7rzgSi26AGf0AiEA8F+9JEy2oE2/QIIzveZbhbvB+tBfsAh71EHiXHmjmNA="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"0.1.2":{"name":"xhr-write-stream","version":"0.1.2","description":"writable ordered stream of xhr requests","main":"index.js","browserify":"browser.js","directories":{"example":"example","test":"test"},"dependencies":{"ordered-emitter":"~0.1.0","concat-stream":"~0.1.0"},"repository":{"type":"git","url":"git://github.com/substack/xhr-write-stream.git"},"homepage":"https://github.com/substack/xhr-write-stream","keywords":["xhr","http","browser","ajax"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","readme":"# xhr-write-stream\n\nWrite data in the browser and receive a properly ordered stream in node from\nmultiple incoming requests.\n\nThis module only goes one way, from the browser to node. Use libraries like\n[shoe](http://github.com/substack/shoe) to create full duplex streams between\nthe browser and node.\n\n# example\n\nbrowser code:\n\n``` js\nvar xws = require('xhr-write-stream');\n\nvar ws = xws('/robots');\nws.write('beep boop');\nws.write('!!!');\nws.end();\n```\n\nserver code:\n\n``` js\nvar http = require('http');\nvar ecstatic = require('ecstatic')(__dirname + '/static');\nvar xws = require('xhr-write-stream')();\n\nvar server = http.createServer(function (req, res) {\n    if (req.url === '/robots') {\n        req.pipe(xws(function (stream) {\n            stream.pipe(process.stdout, { end : false });\n        }));\n        req.on('end', res.end.bind(res));\n    }\n    else ecstatic(req, res)\n});\nserver.listen(5000);\n```\n\nbundle up the browser code with\n[browserify](https://github.com/substack/node-browserify):\n\n```\n$ browserify browser.js -o static/bundle.js\n```\n\nthen toss down a script tag for the bundle:\n\n``` html\n<script src=\"bundle.js\"></script>\n```\n\nRun the server and visit the page in the browser:\n\n```\n$ node server.js\nbeep boop!!!\n```\n\n# browser methods\n\n``` js\nvar xws = require('xhr-write-stream')\n```\n\n## var ws = xws(path)\n\nReturn a writable stream that sends an xhr request to `path` on every `write()`.\n\nThe xhr requests are turned back into a single readable stream on the server\nside.\n\n# server methods\n\n``` js\nvar createXWS = require('xhr-write-stream')\n```\n\n## var xws = createXWS(opts={})\n\nCreate a new `xws` stream pool.\n\n`opts.timeout` is the time in milliseconds to wait for connection activity\nbefore dropping the connection and removing the stream. Default value: 60*1000\n\n## var ws = xws(cb)\n\nReturn a writable stream `ws` that you can pipe request data into from multiple\nincoming xhr requests on the browser-side.\n\n`cb(stream)` is called with a readable `stream` that aggregates data in order\nwith the data from each xhr request.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install xhr-write-stream\n```\n\nThis module makes use of\n[http-browserify](https://github.com/substack/http-browserify)\nfor the xhr-compatibility. If you just `require('xhr-write-stream')` in your\nbrowser code using [browserify](https://github.com/substack/node-browserify),\neverything will just work™.\n\n# license\n\nMIT\n","_id":"xhr-write-stream@0.1.2","dist":{"shasum":"e357848e0d039b411fdd5b3bf81be47ee5ce26aa","tarball":"https://registry.npmjs.org/xhr-write-stream/-/xhr-write-stream-0.1.2.tgz","integrity":"sha512-KLYqF/tkuGjHovIX5GjPPas+Ij1xxnIJG3v4Z73hQhKErm5rOqZSLV0lYxigPueDCOogf9jbey5WXrkPtr8gLQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDLq5mqtFPZIFUjCuoiH5dbn9ORXwfFbhB3HE8IGaptiAiEAoA3p94+A6XBMY6h5EKoiwy+xIq2vBxocd5WA9/5f2sY="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]}},"readme":"# xhr-write-stream\n\nWrite data in the browser and receive a properly ordered stream in node from\nmultiple incoming requests.\n\nThis module only goes one way, from the browser to node. Use libraries like\n[shoe](http://github.com/substack/shoe) to create full duplex streams between\nthe browser and node.\n\n# example\n\nbrowser code:\n\n``` js\nvar xws = require('xhr-write-stream');\n\nvar ws = xws('/robots');\nws.write('beep boop');\nws.write('!!!');\nws.end();\n```\n\nserver code:\n\n``` js\nvar http = require('http');\nvar ecstatic = require('ecstatic')(__dirname + '/static');\nvar xws = require('xhr-write-stream')();\n\nvar server = http.createServer(function (req, res) {\n    if (req.url === '/robots') {\n        req.pipe(xws(function (stream) {\n            stream.pipe(process.stdout, { end : false });\n        }));\n        req.on('end', res.end.bind(res));\n    }\n    else ecstatic(req, res)\n});\nserver.listen(5000);\n```\n\nbundle up the browser code with\n[browserify](https://github.com/substack/node-browserify):\n\n```\n$ browserify browser.js -o static/bundle.js\n```\n\nthen toss down a script tag for the bundle:\n\n``` html\n<script src=\"bundle.js\"></script>\n```\n\nRun the server and visit the page in the browser:\n\n```\n$ node server.js\nbeep boop!!!\n```\n\n# browser methods\n\n``` js\nvar xws = require('xhr-write-stream')\n```\n\n## var ws = xws(path)\n\nReturn a writable stream that sends an xhr request to `path` on every `write()`.\n\nThe xhr requests are turned back into a single readable stream on the server\nside.\n\n# server methods\n\n``` js\nvar createXWS = require('xhr-write-stream')\n```\n\n## var xws = createXWS()\n\nCreate a new `xws` stream pool.\n\n## var ws = xws(cb)\n\nReturn a writable stream `ws` that you can pipe request data into from multiple\nincoming xhr requests on the browser-side.\n\n`cb(stream)` is called with a readable `stream` that aggregates data in order\nwith the data from each xhr request.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install xhr-write-stream\n```\n\nThis module makes use of\n[http-browserify](https://github.com/substack/http-browserify)\nfor the xhr-compatibility. If you just `require('xhr-write-stream')` in your\nbrowser code using [browserify](https://github.com/substack/node-browserify),\neverything will just work™.\n\n# license\n\nMIT\n","maintainers":[{"email":"nopersonsmodules@gmail.com","name":"nopersonsmodules"}],"time":{"modified":"2022-11-08T10:41:38.133Z","created":"2012-11-19T14:06:40.840Z","0.0.0":"2012-11-19T14:06:45.617Z","0.1.0":"2012-11-19T15:32:21.549Z","0.1.1":"2012-11-27T01:32:41.190Z","0.1.2":"2012-11-27T01:42:37.222Z"},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"repository":{"type":"git","url":"git://github.com/substack/xhr-write-stream.git"}}