npm install bash-parserParses bash source code to produce an AST





``bash`
npm install --save bash-parser
`js`
const parse = require('bash-parser');
const ast = parse('echo ciao');
ast result is:
`js`
{
type: "Script",
commands: [
{
type: "SimpleCommand",
name: {
text: "echo",
type: "Word"
},
suffix: [
{
text: "ciao",
type: "Word"
}
]
}
]
}
* cash - This parser should become the parser used by cash (and also vorpal)nsh
* nsh - This parser should become the parser used by js-shell-parse
* js-shell-parse - bash-parser was born as a fork of , but was rewritten to use a jison` grammar
* jison - Bison in JavaScript.
Look in documents folder
The MIT License (MIT)
Copyright (c) 2016 vorpaljs