nowfound

Life & fun · July 25, 2020

BJ

Basho.js – Use JavaScript in your shell scripts

Basho.js – Use JavaScript in your shell scripts launched on July 25, 2020 with 5 votes, #1,626 of 4,305 launches that month and more than 50% of that year's launches. The site was still online in September 2026, 6 years on.

What it does

Bashō lets you to write complex shell tasks using plain JavaScript. It mixes well with shell commands and scripts; so you can mix them with JavaScript in the same line. You can use the npx command to try basho without installing. Bashō evaluates a pipeline of instructions left to right. Instructions can be JavaScript code, reference to an external JS file, or a shell command. What makes basho interesting is Lazy Evaluation , more on this later. To evaluate a JavaScript expression, use the 'js' option -j. Let’s start with a single item in the pipeline, a JavaScript constant. The option -p avoids printing the final result. This is rarely used, but it is sometimes useful along with the error()…from bashojs.org

Does a similar job

all alternatives →
  • AC
  • Redo – Command line utility for quickly creating shell functions2022 · github.com · ▲124

    Redo is the ultimate tool to create reusable functions from your history in an interactive way - barthr/redo

  • Bashnode2024 · ▲125

    Build code-free custom CLIs

  • Jb / json.bash – Command-line tool (and bash library) that creates JSON2024 · github.com · ▲183

    jb is a UNIX tool that creates JSON, for shell scripts or interactive use. Its "one thing" is to get shell-native data (environment variables, files, program output) to somewhere else, using JSON encapsulate it robustly. I wrote this because I wanted a robust and ergonomic way to create ad-hoc JSON data from the command line and scripts. I wanted errors to not pass silently, not coerce data types, not put secrets into argv. I wanted to leverage shell features/patterns like process substitution, environment variables, reading/streaming from files and null-terminated data. If you…

  • Shello2023 · shello.app · ▲104

    Wrangle environment variables

  • Run unknown shell script with a line-by-line confirmation prompt2021 · gist.github.com · ▲158

    Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand. - LICENSE

More life & fun this month

the category →

Source: Show HN post ↗

Launched alongside, July 2020

the whole month →