Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lirantal/opn-shell

cross-platform execution of command line programs in shells
https://github.com/lirantal/opn-shell

nodejs shell terminal terminal-emulator

Last synced: 26 days ago
JSON representation

cross-platform execution of command line programs in shells

Awesome Lists containing this project

README

        


opn-shell


Execute shell commands and detect cross-platform terminal emulators


npm version
license
downloads
build
codecov
Known Vulnerabilities
Security Responsible Disclosure

# About

`opn-shell` allows you to execute shell commands in a terminal emulator window that opens either as a tab or a new window (depending on your terminal emulator) configuration.

It will automatically detect the available terminal emulators that exist in your OS and supports both MacOS and Linux, with a fallback to the associated program on Windows.

# Install

```bash
npm install --save opn-shell
```

# Usage

Call `opn-shell()` with a full path to an executable that will be launched in a terminal window.

If the promise returned by `opn-shell()` rejects then it failed to detect and open a terminal window.

```js
// @TODO
const TerminalLauncher = require('opn-shell')

const executable = '/usr/local/bin/my-shell-program.sh'
TerminalLauncher.launchTerminal({ path: executable }).catch(err => {
console.log(err)
})
```

## CLI

```shell
npx opn-shell my-shell-program.sh
```

# Contributing

Please consult [CONTIRBUTING](./CONTRIBUTING.md) for guidelines on contributing to this project.

# Author

**opn-shell** © [Liran Tal](https://github.com/lirantal), Released under the [Apache-2.0](./LICENSE) License.