JavaScript for shell scripting?

Open
#31 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
electron, javascript, node.js
Domain
cli, desktop

Research direction

No repository files, tests, or implementation entry point are named. Start by reviewing the linked gist and the MDN JavaScript shells page, then define the runtime scope and how synchronous system calls would work; done would require an agreed implementation plan for the proposed JavaScript shell.

Written by the indexing model from the issue text.

Description

Has anyone done a JavaScript implementation system calls are synchronous? I'd like to use JavaScript the way other people use shell scripts.

Here's an example of the kind of code I routinely write as part of my development process. This script runs whenever I save one of my Node projects, and copies the public files to the place where my GitHub repo lives. It's not written in JavaScript, but I'd like to create a system where it could be.

I like having a full programming language, with variables, structures and arrays, persistent data, and all the flow control syntax of an Algol-like language. This is a situation where the efficiencies of async is not appropriate, makes things far too complex for system scripting applications.

I did some searching, found this page of JavaScript shells on MDN. Can't tell which of them might be an answer. I have a feeling that it's not going to be based on V8.

For people who are familiar with Frontier, a system scripting environment I developed in the 80s and 90s, I would like to do something like that, but in JavaScript, possibly running in an Electron shell. I know it would be weird to have another JavaScript interpreter running inside Electron, but I've seen weirder things.

PS: Though I'm sure no one will read this far -- the answer is not promises, or async functions in ES6. I want much much more simplicity in the scripts.

Dominant language
HTML
Stars
134
Forks
10
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from scripting/Scripting-News

All issues in scripting/Scripting-News

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.