js-code-context
RegExp expressions to parse javascript code context - for node and the browser.
Install
Install with npm
$ npm install js-code-context
Usage & Example
For a more comprehensive examples, see the tests.
var fs = ;var parseCodeContext = ;var context = fs; ; ; var response = parseCodeContext;//=> returns array with 1 object for parsed 7th line of context//=> or array with error object
CLI
CLI uses
.sync
method. But it's not so sync, if we must be honest - in fact it's asynchronous. It just returns resulted array in variable, not in callback.
$ npm install --global js-code-context
$ jsCodeContext --help
Options
--help | -h show help
--line | -l specify which line to parse
--file | -f file that want to parse
Example
$ jsCodeContext -f ./test/fixture.js -l 6
//=> array with one object
Tests
As usual -
npm test
or if you have mocha globally -mocha
.
$ npm test
Authors & Contributors
Charlike Mike Reagent
License
Copyright (c) 2014 Charlike Mike Reagent, contributors.
Released under the MIT
license.