JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3317
  • Score
    100M100P100Q154979F
  • License MIT

Standard compliant bash parser

Package Exports

  • bash-parser

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bash-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

bash-parser

Parses bash source code to produce an AST

Travis Build Status Coveralls NPM module NPM downloads Try online

Installation

npm install --save bash-parser

Usage

  const parse = require('bash-parser');
  const ast = parse('echo ciao');

ast result is:

{
        type: "Script",
        commands: [
            {
                type: "SimpleCommand",
                name: {
                    text: "echo",
                    type: "Word"
                },
                suffix: [
                    {
                        text: "ciao",
                        type: "Word"
                    }
                ]
            }
        ]
    }

Related projects

  • cash - This parser should become the parser used by cash (and also vorpal)
  • nsh - This parser should become the parser used by nsh
  • js-shell-parse - bash-parser was born as a fork of js-shell-parse, but was rewritten to use a jison grammar
  • jison - Bison in JavaScript.

Documentation

Look in documents folder

License

The MIT License (MIT)

Copyright (c) 2016 vorpaljs