Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/winkgroup/cmd
https://github.com/winkgroup/cmd
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/winkgroup/cmd
- Owner: WINKgroup
- License: mit
- Created: 2022-08-10T11:26:57.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-18T19:38:47.000Z (9 months ago)
- Last Synced: 2024-11-08T10:14:34.880Z (3 months ago)
- Language: TypeScript
- Size: 79.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cmd
Helper library to manage long running shell commands## Install
```
npm install @winkgroup/cmd
```## Usage
```js
import Cmd from '@winkgroup/cmd'async function go() {
const ls = await Cmd.run('ls')
console.log(ls)
process.exit()
}go()
```
this will run *ls* command on the shell and return the output in ls variableyou can check if a command exists using exists method:
```js
...
const exists = Cmd.exists('ls')
if (exists) console.log('mongo is a command')
else console.error('command not found')
```## Maintainers
* [fairsayan](https://github.com/fairsayan)