[Pkg-javascript-commits] [node-read-only-stream] 03/22: example

Bastien Roucariès rouca at moszumanska.debian.org
Sun Aug 20 13:52:18 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-read-only-stream.

commit df38d877b89d12fa315aef6c17540bd4967c458b
Author: James Halliday <mail at substack.net>
Date:   Mon Sep 8 11:14:25 2014 +0100

    example
---
 example/main.js | 3 +++
 example/wrap.js | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/example/main.js b/example/main.js
new file mode 100644
index 0000000..22720fe
--- /dev/null
+++ b/example/main.js
@@ -0,0 +1,3 @@
+var wrap = require('./wrap.js');
+var ro = wrap(); // can't write to `ro` and muck up internal state
+ro.pipe(process.stdout);
diff --git a/example/wrap.js b/example/wrap.js
new file mode 100644
index 0000000..5586081
--- /dev/null
+++ b/example/wrap.js
@@ -0,0 +1,8 @@
+var through = require('through2');
+var readonly = require('../');
+
+module.exports = function () {
+    var stream = through();
+    stream.end('wooooo\n');
+    return readonly(stream);
+};

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-read-only-stream.git



More information about the Pkg-javascript-commits mailing list