[Pkg-javascript-commits] [node-browser-pack] 02/141: docs

Bastien Roucariès rouca at moszumanska.debian.org
Thu May 4 10:23:19 UTC 2017


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

rouca pushed a commit to branch master
in repository node-browser-pack.

commit 985b3e379bc071025fe84807f21ba186b897dd24
Author: James Halliday <mail at substack.net>
Date:   Mon Feb 11 00:07:00 2013 -0800

    docs
---
 readme.markdown | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/readme.markdown b/readme.markdown
new file mode 100644
index 0000000..819e701
--- /dev/null
+++ b/readme.markdown
@@ -0,0 +1,61 @@
+# browser-bundle
+
+pack node-style source files from a json stream into one or more browser bundles
+
+# example
+
+json input:
+
+``` json
+[
+  {
+    "id": "a1b5af78",
+    "source": "console.log(require('./foo')(5))",
+    "deps": { "./foo": "b8f69fa5" },
+    "entry": true
+  },
+  {
+    "id": "b8f69fa5",
+    "source": "module.exports = function (n) { return n * 111 }",
+    "deps": {}
+  }
+]
+```
+
+bundle script:
+
+``` js
+var pack = require('browser-pack')();
+process.stdin.pipe(pack).pipe(process.stdout);
+process.stdin.resume();
+```
+
+output:
+
+```
+$ browser-bundle < input.json
+(function(p,c,e){function r(n){if(!c[n]){c[n]={exports:{}};p[n][0](function(x){return r(p[n][1][x])},c[n],c[n].exports);}return c[n].exports}for(var i=0;i<e.length;i++)r(e[i]);return r})({"a1b5af78":[function(require,module,exports){console.log(require('./foo')(5))},{"./foo":"b8f69fa5"}],"b8f69fa5":[function(require,module,exports){module.exports = function (n) { return n * 111 }},{}]},{},["a1b5af78","b8f69fa5"])
+```
+
+# methods
+
+``` js
+var pack = require('browser-pack');
+```
+
+## pack()
+
+Return a through stream that takes a stream of json input and produces a stream
+of javascript output.
+
+# install
+
+With [npm](https://npmjs.org) do:
+
+```
+npm install browser-pack
+```
+
+# license
+
+MIT

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-browser-pack.git



More information about the Pkg-javascript-commits mailing list