shell script replacement; write shell scripts in js instead of bash, then run them with a single static binary

Overview

yavascript

YavaScript is a bash-like script runner which is distributed as a single statically-linked binary. Scripts are written in JavaScript. There are global APIs available for all the things you'd normally want to do in a bash script, such as:

  • Running programs
  • Accessing environment variables
  • Reading and writing file contents
  • Checking if files/folders exist
  • Removing files/folders
  • Reading and changing the current working directory
  • Using globs to get large lists of files
  • Printing stylized text to the terminal

Additionally, since it's JavaScript, you get some other features that are either not present in bash or are cumbersome to use in bash, namely:

  • Arrays (lists) and Objects (key/value dictionaries)
  • Working with path strings
  • Working with JSON
  • Cross-file import/export using ECMAScript Modules
  • Splitting strings on delimeters
  • Pretty-printing of objects
  • Getting the path to the currently-running script (via import.meta.url or __filename)
  • Getting the absolute path to the root folder of the current git/mercurial repo (repoRoot function)

To view the APIs, consult the file yavascript.d.ts which was distributed with this program, or online at https://github.com/suchipi/yavascript/blob/main/yavascript.d.ts. This file contains TypeScript type definitions which can be given to your IDE to assist you when writing scripts.

YavaScript is powered by a fork of the QuickJS JavaScript Engine, originally written by Fabrice Bellard. QuickJS is a small, fast JavaScript engine supporting the ES2020 specification.

YavaScript is written with <3 by Lily Scott.

You might also like...

This is a Webpack based to-do-list project. With this app, users can add thier daily routine tasks to the list, mark them as complet, edit them or delete them.

To Do List This is a Webpack based to-do-list project. With this app, users can add thier daily routine tasks to the list, mark them as complet, edit

Oct 30, 2022

Gofiber with NextJS Static HTML is a small Go program to showcase for bundling a static HTML export of a Next.js app

Gofiber and NextJS Static HTML Gofiber with NextJS Static HTML is a small Go program to showcase for bundling a static HTML export of a Next.js app. R

Jan 22, 2022

A library that helps you write a static dropdown menu that follows the digital accessibility recommendations.

JSPanel A library that helps you write a static dropdown menu, a panel, that follows the digital accessibility recommendations. Get started First of a

Apr 29, 2021

Binary-encoded serialization of JavaScript objects with generator-based parser and serializer

YaBSON Schemaless binary-encoded serialization of JavaScript objects with generator-based parser and serializer This library is designed to transfer l

Aug 9, 2022

ltp is a parseless copyfree binary encoding format

ltp is a parseless copyfree binary encoding format. This means that you can read a field out of ltp encoded data without

Aug 10, 2022

Glorious Binary Serialization and Deserialization for TypeScript.

Glorious Binary Serialization and Deserialization for TypeScript.

Glorious SerDes for TypeScript The library you can rely on, For binary serialization and deserialization, In Node, Deno, and the Web environment, Whic

Dec 11, 2022

Library to download binary files from GitHub releases detecting the correct platform.

Dbin TypeScript library to download binary files from GitHub releases detecting the correct platform. Example: import dbin from "https://deno.land/x/d

Oct 4, 2022

Powershell scripts and Update script for Powershell configs and oh-my-posh themes

windows-powershell-autoconfig What is it? It is a NodeJS Project which updates your powershell and oh-my-posh scripts. Why should I use it? It is very

Dec 28, 2022
Releases(v0.0.7)
Owner
Lily Scott
Former Prettier Core Maintainer, Former Babel team member. Interested in JavaScript, TypeScript, Rust, Unity, VR, Dev Tooling, Dev Experience, React, and more.
Lily Scott
Run a command, watch the filesystem, stop the process on file change and then run the command again...

hubmon Run a command, watch the filesystem, stop the process on file change and then run the command again... Install You can install this command lin

Hubert SABLONNIÈRE 7 Jul 30, 2022
A generative engine that takes various png layers on a sprite sheet format, combines them and then converts them into a .gif file

Welcome to the Generative GIF Engine v2.0.4 ?? [8 minute read] This python and node app generates layered-based gifs to create NFT gif art! It is fast

Jalagar 112 Jan 2, 2023
A generative engine that takes various png layers on a sprite sheet format, combines them and then converts them into a .gif file

Welcome to the Generative Animated Engine v3.0.1 ?? [8 minute read] This repo used to be called jalagar/Generative_Gif_Engine but because it now suppo

Jalagar 47 May 24, 2022
A simple to do list webpage where you can log the daily tasks you have to do, mark them as checked, modify them, reorder them and remove them. Made using HTML, CSS and JavaScript.

To-Do-List This Webpage is for an app called To-Do-List which helps you add, remove or check tasks you have to do. It is a simple web page which conta

Zeeshan Haider 9 Mar 12, 2022
A Cypress plugin that generates test scripts from your interactions, a replacement Cypress Studio for Cypress v10 🖱 ⌨

DeploySentinel Cypress Recorder Plugin Create Cypress tests scripts within the Cypress test browser by simply interacting with your application, simil

DeploySentinel 13 Dec 15, 2022
✏️ A small jQuery extension to turn a static HTML table into an editable one. For quickly populating a small table with JSON data, letting the user modify it with validation, and then getting JSON data back out.

jquery-editable-table A small jQuery extension to turn an HTML table editable for fast data entry and validation Demo ?? https://jsfiddle.net/torrobin

Tor 7 Jul 31, 2022
Automated packaging of Debian-flavored NGINX with PageSpeed modules. Written in Bash and GitHub Workers. APT Repository hosted on Dokku.

NGINX + Google PageSpeed Configuring NGINX to build correctly is a pain. Not because of anything wrong with it, but rather because of how slim the sta

Slava Knyazev 21 Oct 14, 2022
GPT-3 powered cli tool to help with bash commands you can't remember

qwery GPT-3 powered cli tool to help with bash commands you can't remember eg $ qw ffmpeg command to transcode mp4 to mov QWERY RESULT: ffmpeg -i inpu

Aaron Peddle 4 Oct 31, 2022
Chat with GPT from the terminal, with the ability to execute shell scripts.

ChatSH Chat with GPT from the terminal, and let it execute shell scripts and perform tasks for you. What could go wrong? Example Why? The reason I'm p

Victor Taelin 47 Jun 11, 2023
The Happy Devs Leaderboard allows users to submit their scores. The app then ranks them from highest scores to the lowest.

HAPPY DEVS LEADERBOARD The HAPPY DEVS LEADERBOARD app allows users to submit their scores to be ranked on the Leaderboard. Live Demo Live Demo Link Bu

Benjamin Semah 3 Feb 10, 2022