Permalink
Browse files

Update README.md

  • Loading branch information...
1 parent 4f97f72 commit ad05bf85b71c81f6da09729da4259a89c2df75ae @ecdeveloper committed Aug 15, 2012
Showing with 27 additions and 1 deletion.
  1. +27 −1 README.md
View
@@ -1,4 +1,30 @@
node-named-argv
===============
-A simple node.js module that helps adding named parameters to a node app call
+A simple node.js module that helps adding named parameters to a node app call
+
+installing
+==========
+
+ npm install named-argv
+
+usage
+=====
+
+You may use both '--' and '-' prefixes for your named parameters:
+
+ node myapp.js --opt1=value1 -opt2=value
+
+You may also pass unnamed parameters:
+
+ node myapp.js unnamed1 unnamed2
+
+In your code:
+
+ var argv = require('named-argv');
+ console.log(argv.opts); // opts object contains all named parameters
+ console.log(argv.params); // array, contains all unnamed parameters
+
+Passing arrays to arguments? Yes, it's possible:
+
+ node myapp.js --optarr=val1 --optarr=val2 --optarr=val3

0 comments on commit ad05bf8

Please sign in to comment.