Registry / devops / powscript

powscript

JSON →
library1.1.2jsnpmunverified

Powscript is a bash dialect transpiler written in bash that provides a CoffeeScript-inspired, indentation-based syntax for shell scripting. It compiles to bash (version 4+) or experimental POSIX sh, reducing semantic noise from traditional shell syntax. Features include automatic quoting, safety checks (halt on error, require_cmd/require_env), functional programming constructs, JSON support, module system, and easy async. The current stable version is 0.9 (based on old compiler), with a new compiler in development (beta available). It is self-installing with no external dependencies (bash-only) and targets embedded systems or any environment where bash is available. Key differentiator: no need for gcc or node – pure bash, but not actively maintained.

npm install powscript
INSTALL
IMPORT
SIG · POWSCRIPT
P
powscript
devopsjavascriptv1.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

powscript
./powscript myscript.pow
npm install powscript
Powscript is a shell script, not a JavaScript package. Download and execute directly.
compile
./powscript -c myscript.pow > myscript.bash
./powscript -o output bash myscript.pow
Use -c for compile to bash, --sh for POSIX sh output.
run
./powscript myscript.pow
bash myscript.pow
Run .pow files directly with powscript interpreter.

Install powscript, create a simple script with argument handling, run it directly, and compile to bash.

wget "https://raw.githubusercontent.com/coderofsalvation/powscript/master/powscript" -O /usr/local/bin/powscript && chmod 755 /usr/local/bin/powscript # Create a test.pow file: cat > test.pow << 'EOF' #!/usr/bin/env powscript require_cmd 'echo' require_env 'HOME' run(@args -- foo) if empty? foo echo "error: please pass --foo <string>" exit 1 echo $args[@] "$foo universe!!" echo "HOME=$HOME" run $@ EOF # Run it: powscript test.pow hello --foo powful # Or compile to bash: powscript -c test.pow > test.bash
powscript --version
Debug
Known issues
gotchaPowscript requires bash >= 4.x. Running on older bash versions will cause errors.
fix
Upgrade bash to version 4 or later, or use a different shell.
affects: <0.0
breakingThe new compiler (beta) is not backward compatible; scripts written for the old compiler may not work.
fix
Check the beta compiler repository for migration notes.
affects: >=0.9
deprecatedProject is in maintenance mode with no active development. The README points to a beta version by another author.
fix
Consider alternatives like shellcheck, bashate, or writing bash directly if future support is needed.
affects: >=1.1.2
gotchaPOSIX sh output (--sh flag) is experimental and may contain bashisms if the powscript uses bash-specific features.
fix
Manually verify output with checkbashisms or stick to bash output.
affects: >=0.9
Errors
Common errors & fixes
bash: powscript: command not found
Powscript not installed in PATH or not executable.
fix
Download and make executable: wget -O /usr/local/bin/powscript https://raw.githubusercontent.com/coderofsalvation/powscript/master/powscript && chmod +x /usr/local/bin/powscript
./powscript: line 1: syntax error near unexpected token `newline'
The powscript file was not downloaded correctly (e.g., missing shebang).
fix
Re-download the raw script from GitHub using wget or curl.
require_cmd: echo: command not found
The required command is not installed on the system.
fix
Install the missing command (e.g., via apt-get, yum) or remove the require_cmd line.
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
powscript — npm install powscript · libregistry