https://github.com/winkgroup/cmd
https://github.com/winkgroup/cmd
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/winkgroup/cmd
- Owner: WINKgroup
- License: mit
- Created: 2022-08-10T11:26:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-18T19:38:47.000Z (over 1 year ago)
- Last Synced: 2025-02-26T04:09:47.747Z (9 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 variable
you 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)