# @ericcornelissen/bash-parser

> Standard compliant bash parser

Latest version **0.5.3** (published 2024-06-08) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @ericcornelissen/bash-parser
pnpm add @ericcornelissen/bash-parser
yarn add @ericcornelissen/bash-parser
bun add @ericcornelissen/bash-parser
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.5.3 |
| Published | 2024-06-08 |
| First published | 2023-07-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 17 |
| Unpacked size | 192.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | ericcornelissen |

## Links

- npm: https://www.npmjs.com/package/@ericcornelissen/bash-parser
- Repository: https://github.com/ericcornelissen/bash-parser
- Homepage: https://github.com/ericcornelissen/bash-parser#readme
- Issues: https://github.com/ericcornelissen/bash-parser/issues
- npm.io page: https://npm.io/package/@ericcornelissen/bash-parser

## Dependencies (17)

- [babylon](https://npm.io/package/babylon.md) ^6.9.1
- [map-obj](https://npm.io/package/map-obj.md) ^2.0.0
- [array-last](https://npm.io/package/array-last.md) ^1.1.1
- [filter-obj](https://npm.io/package/filter-obj.md) ^1.1.0
- [is-iterable](https://npm.io/package/is-iterable.md) ^1.1.0
- [unescape-js](https://npm.io/package/unescape-js.md) ^1.0.5
- [lodash.curry](https://npm.io/package/lodash.curry.md) ^4.1.1
- [magic-string](https://npm.io/package/magic-string.md) ^0.16.0
- [object-pairs](https://npm.io/package/object-pairs.md) ^0.1.0
- [object-values](https://npm.io/package/object-values.md) ^1.0.0
- [to-pascal-case](https://npm.io/package/to-pascal-case.md) ^1.0.0
- [compose-function](https://npm.io/package/compose-function.md) ^3.0.3
- [has-own-property](https://npm.io/package/has-own-property.md) ^0.1.0
- [shell-quote-word](https://npm.io/package/shell-quote-word.md) ^1.0.1
- [identity-function](https://npm.io/package/identity-function.md) ^1.0.0
- [reverse-arguments](https://npm.io/package/reverse-arguments.md) ^1.0.0
- [iterable-lookahead](https://npm.io/package/iterable-lookahead.md) ^1.0.0

## Recent versions

- 0.5.3 (latest) — 2024-06-08
- 0.5.2 — 2023-07-10
- 0.5.1 — 2023-07-10

## README

# bash-parser

A fork of [`vorpaljs/bash-parser`](https://github.com/vorpaljs/bash-parser) - Parses bash source code to produce an AST

This fork is focussed at dependency maintenance and will not receive any updates beyond that. No new features, no bug (nor security) fixes.

# Installation

```bash
npm install --save bash-parser
```

# Usage

```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"
					}
				]
			}
		]
	}
```

# Related projects

* [cash](https://github.com/dthree/cash) - This parser should become the parser used by `cash` (and also [vorpal](https://github.com/dthree/vorpal))
* [nsh](https://github.com/piranna/nsh) - This parser should become the parser used by `nsh`
* [js-shell-parse](https://github.com/grncdr/js-shell-parse) - bash-parser was born as a fork of `js-shell-parse`, but was rewritten to use a `jison` grammar
* [jison](https://github.com/zaach/jison) - Bison in JavaScript.

# Documentation

Look in [documents folder](https://github.com/vorpaljs/bash-parser/tree/master/documents)

# License

The MIT License (MIT)

Copyright (c) 2016-2022 vorpaljs
Copyright (c) 2023-2024 ericcornelissen, sockmaster27

---
_Source: https://npm.io/package/@ericcornelissen/bash-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
