[Pkg-javascript-commits] [node-browserify-lite] 02/03: Imported Upstream version 0.2.0

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Fri Oct 3 19:04:00 UTC 2014


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

andrewrk-guest pushed a commit to branch master
in repository node-browserify-lite.

commit d4c86db25a3b0b9c4561ceff86ce34479111f6d3
Author: Andrew Kelley <superjoe30 at gmail.com>
Date:   Fri Oct 3 18:52:37 2014 +0000

    Imported Upstream version 0.2.0
---
 README.md    | 11 +++++++++++
 cli.js       | 23 +++++++++++++++++++----
 package.json |  2 +-
 3 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 3a44701..5481f53 100644
--- a/README.md
+++ b/README.md
@@ -8,4 +8,15 @@ browserify, minus some of the advanced features and heavy dependencies.
      control statements, and objects.
  * Only supports a single entry file and the `--outfile` parameter,
    nothing else.
+ * No source maps.
  * Minimal dependencies.
+
+## Usage
+
+```
+browserify-lite ./src/app.js --outfile public/app.js
+```
+
+./src/app.js can depend on any modules using Node.js's
+[module resolution system](http://nodejs.org/docs/latest/api/modules.html#modules_all_together)
+and they will be bundled as well.
diff --git a/cli.js b/cli.js
index 14fc7d8..381a272 100755
--- a/cli.js
+++ b/cli.js
@@ -7,16 +7,31 @@ var entrySourcePath = process.argv[2];
 var outputFileParam = process.argv[3];
 var outBundlePath = process.argv[4];
 
+if (entrySourcePath === '--help') {
+  usage();
+}
+
 if (outputFileParam !== '--outfile') {
-  console.error("Expected second param to be --outfile");
-  process.exit(1);
+  console.error("Expected second param to be --outfile\n");
+  usage();
 }
 
 if (!outBundlePath || !entrySourcePath) {
-  console.error("Expected first arg to be source path and third arg to be out bundle path.");
-  process.exit(1);
+  console.error("Expected first arg to be source path and third arg to be out bundle path.\n");
+  usage();
 }
 
 browserifyLite.createBundle(entrySourcePath, outBundlePath, function(err) {
   if (err) throw err;
 });
+
+
+function usage() {
+  console.error(
+      "Usage: browserify-lite ./entry-file.js --outfile bundle.js\n" +
+      "\n" +
+      "Standard Options:\n" +
+      "\n" +
+      "        --outfile  Write the browserify bundle to this file.");
+  process.exit(1);
+}
diff --git a/package.json b/package.json
index 896c789..045ca22 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "browserify-lite",
-  "version": "0.0.1",
+  "version": "0.2.0",
   "description": "browserify, minus some of the advanced features and heavy dependencies.",
   "main": "index.js",
   "scripts": {

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



More information about the Pkg-javascript-commits mailing list