0.0.1 • Published 12 years ago

file-command-parser v0.0.1

Weekly downloads
7
License
-
Repository
github
Last release
12 years ago

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' ] ]