file-command-parser

commandParser get command with args from file or string

npm install file-command-parser
4 downloads in the last month

commandParser

Use for parse file with command.

Example

script

var CommandParser = require('commandParser');

var commandParser = new CommandParser();
commandParser.file('test');
console.log(commandParser.parse());

input

command1 "arg1 test" arg2 arg3
#comment
command2 arg4 'temp lorem lipsum'
     command3
     command4
     command5 arg5 arg4 "arg6"

output

[ [ 'command1', 'arg1 test', 'arg2', 'arg3' ],
  false,
  [ 'command2', 'arg4', 'temp lorem lipsum' ],
  [ 'command3' ],
  [ 'command4' ],
  [ 'command5', 'arg5', 'arg4', 'arg6' ] ]
npm loves you