Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/lirantal/opn-shell
- Owner: lirantal
- License: apache-2.0
- Created: 2018-12-30T21:22:33.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-04-20T12:08:39.000Z (over 2 years ago)
- Last Synced: 2024-10-04T19:59:26.290Z (about 2 months ago)
- Topics: nodejs, shell, terminal, terminal-emulator
- Language: JavaScript
- Size: 820 KB
- Stars: 6
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
opn-shell
Execute shell commands and detect cross-platform terminal emulators# 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.