1.2.1 • Published 2 years ago

@seung_h/node-sh v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

banner

nodejs typescript license

Node-sh is a bash command implementation and os shell command execution for node.js that runs on mac os, linux and windows. It makes you easier to execute your os shell commands. implement bash commands and functionalize it.

🕹 Install

 $ yarn add node-sh
 $ npm install node-sh

🔥 Features

  • TypeScript based, zero dependencies. 📦
  • Simple command execution with user environment.
  • 23 bash commands implemented.
  • Each command supports type-based JavaScript API and pipe commands.
  • Provides details about exceptions in user command with rendered code.

📌 Import

If the $ namespace conflicts, you can use named import rather than global import.

 import 'node-sh' // $.commands
 import bash from 'node-sh' // bash.commands

📝 Commands

Designed to be easy to use, node-sh uses only one interface. it can execute commands and implementations.

🔐 Execute

  const exec = $ `ls -al | grep 'node-sh'`

Caution: This function uses the child process module to execute commands directly.

Environments

 $.env: {
     verbose    : boolean           = false
     prefix     : string            = ''
     shell      : string | boolean  = true
     max_buffer : number            = 200 * 1024 * 1024
 } // structures
 
 $.env.shell = $.which `git`

💡 Implement

Node-sh has implemented syntax and options, etc. similar to bash based on linux man page to improve the user-experience.

🔗 UnixExtension

Each function (except void functions) returns stdout to UnixExtension class that can use JavaScript API according to the type of stdout or pipe functions such as grep, sort, uniq, etc.

🛠 Exceptions

Node-sh provides detail of the exceptions that occurred in user commands or internal and suggests solutions for them.

Note: It is only used for errors handled within the module and cannot be used externally.

exception

📋 License

Distributed under the MIT License. See LICENSE for more information.

1.2.1

2 years ago

1.2.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago