JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q26856F
  • License MIT

cross-platform library to execute commands in a new shells

Package Exports

  • newshell

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (newshell) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

🐚 cross-platform library to execute commands in a new shells

When you have many cli apps that takes the whole terminal, it's useful to run them all with a single command

Features

  • 👯‍♂️ Attempts to use the current terminal
  • 🌏 Cross-platform
  • 📄 Runs js files with node
  • 🗃 Opens the new shell in current working directory
  • 🎛 Supports spliting with iterm2

CLI

Run a command in a new shell

prints "hello world" in a new shell window

newshell "echo 'hello world'"

The new shell will run in the same working directory.

# See for yourself 👀

newshell pwd

You can run multiple shells

newshell "npx tsc --watch" "npx jest --watch"

--file

newshell --file "./script.sh"

Supports running node for javascript files

newshell --file "./script.js"

Node API

command

has the same capabilities of the cli

command(script: string, options: Options): void
type Options = {
  env?: Record<string, string> = {};
  split?: boolean = false;
  splitDirection?: string = "verticaly";
  terminalApp?: string | undefined = $TERM_PROGRAM;
};

file

similar to --file

file(scriptPath: string): void

Future

  • Run npm scripts in a new terminal (and resolve bins from the node_modules/.bin directory)
  • Controll the focus of the terminal window
  • Pass environment parameters from the CLI
  • Manage IPC with the other terminal window (similar to child_process.fork)

CI