# @panda-clouds/parse-bash

> A node helper class for accessing the hosts bash shell using promises

Latest version **2.1.0** (published 2019-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @panda-clouds/parse-bash
pnpm add @panda-clouds/parse-bash
yarn add @panda-clouds/parse-bash
bun add @panda-clouds/parse-bash
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2019-08-21 |
| First published | 2019-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8 |
| Dependencies | 1 |
| Unpacked size | 27.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Marc Smith |
| Maintainers | mrmarcsmith |
| Keywords | bash, parse, server, node, shell |

## Links

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

## Dependencies (1)

- [execa](https://npm.io/package/execa.md) ^2.0.4

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2019-08-21
- 2.0.0 — 2019-08-15
- 1.1.0 — 2019-02-04
- 1.0.0 — 2019-02-04

## README

PCBash
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`PCBash` is a lightweight JavaScript library for Node.js that provides additional Bash methods.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save @panda-clouds/parse-bash
```

Usage
-----

### Node.js

```javascript
const PCBash = require('@panda-clouds/parse-bash');

// example usage
PCBash.runCommandPromise('pwd')
	.then((result)=>{
		console.log(result) // => "/path/to/my/dir";
	});

PCBash.putStringInFile('Hello World!',"/tmp/hello-world")
	.then((result)=>{
		PCBash.runCommandPromise('cat "/tmp/hello-world"')
			.then((result)=>{
				console.log(result) // => "Hello World!";
			});
	}); 
```

You can replace PCBash with any variable.


Methods
-------

[Unit Tests] are an additional resource for learning functionality.

### - runCommandPromise(string)

Returns a promise that is resolved with the contents of stdout.

Example:

```javascript
PCBash.runCommandPromise('pwd')
	.then((result)=>{
		console.log(result) // => "/path/to/my/dir";
	});
```

### - putStringInFile(string)

places the contents of the string into the file path provided


Example:

```javascript
PCBash.putStringInFile('Hello World!',"/tmp/hello-world")
	.then((result)=>{
		PCBash.runCommandPromise('cat "/tmp/hello-world"')
			.then((result)=>{
				console.log(result) // => "Hello World!";
			});
	}); 
```

Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `PCBash.js`
- add unit tests in `PCBash.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)


[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/PCBash.spec.js

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