package.json 6.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. {
  2. "_args": [
  3. [
  4. {
  5. "raw": "delayed-stream@~1.0.0",
  6. "scope": null,
  7. "escapedName": "delayed-stream",
  8. "name": "delayed-stream",
  9. "rawSpec": "~1.0.0",
  10. "spec": ">=1.0.0 <1.1.0",
  11. "type": "range"
  12. },
  13. "/mnt/Data/bach/Documents/ola/OLA#4/OLA#4DOC/sys/node_modules/combined-stream"
  14. ]
  15. ],
  16. "_from": "delayed-stream@>=1.0.0 <1.1.0",
  17. "_id": "delayed-stream@1.0.0",
  18. "_inCache": true,
  19. "_location": "/delayed-stream",
  20. "_nodeVersion": "1.6.4",
  21. "_npmUser": {
  22. "name": "apechimp",
  23. "email": "apeherder@gmail.com"
  24. },
  25. "_npmVersion": "2.8.3",
  26. "_phantomChildren": {},
  27. "_requested": {
  28. "raw": "delayed-stream@~1.0.0",
  29. "scope": null,
  30. "escapedName": "delayed-stream",
  31. "name": "delayed-stream",
  32. "rawSpec": "~1.0.0",
  33. "spec": ">=1.0.0 <1.1.0",
  34. "type": "range"
  35. },
  36. "_requiredBy": [
  37. "/combined-stream"
  38. ],
  39. "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
  40. "_shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619",
  41. "_shrinkwrap": null,
  42. "_spec": "delayed-stream@~1.0.0",
  43. "_where": "/mnt/Data/bach/Documents/ola/OLA#4/OLA#4DOC/sys/node_modules/combined-stream",
  44. "author": {
  45. "name": "Felix Geisendörfer",
  46. "email": "felix@debuggable.com",
  47. "url": "http://debuggable.com/"
  48. },
  49. "bugs": {
  50. "url": "https://github.com/felixge/node-delayed-stream/issues"
  51. },
  52. "contributors": [
  53. {
  54. "name": "Mike Atkins",
  55. "email": "apeherder@gmail.com"
  56. }
  57. ],
  58. "dependencies": {},
  59. "description": "Buffers events from a stream until you are ready to handle them.",
  60. "devDependencies": {
  61. "fake": "0.2.0",
  62. "far": "0.0.1"
  63. },
  64. "directories": {},
  65. "dist": {
  66. "shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619",
  67. "tarball": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz"
  68. },
  69. "engines": {
  70. "node": ">=0.4.0"
  71. },
  72. "gitHead": "07a9dc99fb8f1a488160026b9ad77493f766fb84",
  73. "homepage": "https://github.com/felixge/node-delayed-stream",
  74. "license": "MIT",
  75. "main": "./lib/delayed_stream",
  76. "maintainers": [
  77. {
  78. "name": "felixge",
  79. "email": "felix@debuggable.com"
  80. },
  81. {
  82. "name": "apechimp",
  83. "email": "apeherder@gmail.com"
  84. }
  85. ],
  86. "name": "delayed-stream",
  87. "optionalDependencies": {},
  88. "readme": "# delayed-stream\n\nBuffers events from a stream until you are ready to handle them.\n\n## Installation\n\n``` bash\nnpm install delayed-stream\n```\n\n## Usage\n\nThe following example shows how to write a http echo server that delays its\nresponse by 1000 ms.\n\n``` javascript\nvar DelayedStream = require('delayed-stream');\nvar http = require('http');\n\nhttp.createServer(function(req, res) {\n var delayed = DelayedStream.create(req);\n\n setTimeout(function() {\n res.writeHead(200);\n delayed.pipe(res);\n }, 1000);\n});\n```\n\nIf you are not using `Stream#pipe`, you can also manually release the buffered\nevents by calling `delayedStream.resume()`:\n\n``` javascript\nvar delayed = DelayedStream.create(req);\n\nsetTimeout(function() {\n // Emit all buffered events and resume underlaying source\n delayed.resume();\n}, 1000);\n```\n\n## Implementation\n\nIn order to use this meta stream properly, here are a few things you should\nknow about the implementation.\n\n### Event Buffering / Proxying\n\nAll events of the `source` stream are hijacked by overwriting the `source.emit`\nmethod. Until node implements a catch-all event listener, this is the only way.\n\nHowever, delayed-stream still continues to emit all events it captures on the\n`source`, regardless of whether you have released the delayed stream yet or\nnot.\n\nUpon creation, delayed-stream captures all `source` events and stores them in\nan internal event buffer. Once `delayedStream.release()` is called, all\nbuffered events are emitted on the `delayedStream`, and the event buffer is\ncleared. After that, delayed-stream merely acts as a proxy for the underlaying\nsource.\n\n### Error handling\n\nError events on `source` are buffered / proxied just like any other events.\nHowever, `delayedStream.create` attaches a no-op `'error'` listener to the\n`source`. This way you only have to handle errors on the `delayedStream`\nobject, rather than in two places.\n\n### Buffer limits\n\ndelayed-stream provides a `maxDataSize` property that can be used to limit\nthe amount of data being buffered. In order to protect you from bad `source`\nstreams that don't react to `source.pause()`, this feature is enabled by\ndefault.\n\n## API\n\n### DelayedStream.create(source, [options])\n\nReturns a new `delayedStream`. Available options are:\n\n* `pauseStream`\n* `maxDataSize`\n\nThe description for those properties can be found below.\n\n### delayedStream.source\n\nThe `source` stream managed by this object. This is useful if you are\npassing your `delayedStream` around, and you still want to access properties\non the `source` object.\n\n### delayedStream.pauseStream = true\n\nWhether to pause the underlaying `source` when calling\n`DelayedStream.create()`. Modifying this property afterwards has no effect.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature. You can also modify this property during runtime.\n\n### delayedStream.dataSize = 0\n\nThe amount of data buffered so far.\n\n### delayedStream.readable\n\nAn ECMA5 getter that returns the value of `source.readable`.\n\n### delayedStream.resume()\n\nIf the `delayedStream` has not been released so far, `delayedStream.release()`\nis called.\n\nIn either case, `source.resume()` is called.\n\n### delayedStream.pause()\n\nCalls `source.pause()`.\n\n### delayedStream.pipe(dest)\n\nCalls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.\n\n### delayedStream.release()\n\nEmits and clears all events that have been buffered up so far. This does not\nresume the underlaying source, use `delayedStream.resume()` instead.\n\n## License\n\ndelayed-stream is licensed under the MIT license.\n",
  89. "readmeFilename": "Readme.md",
  90. "repository": {
  91. "type": "git",
  92. "url": "git://github.com/felixge/node-delayed-stream.git"
  93. },
  94. "scripts": {
  95. "test": "make test"
  96. },
  97. "version": "1.0.0"
  98. }