npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@gutenye/script.js

v1.0.1

Published

Write shell scripts in JavaScript

Readme

🧩 Script.js 🧩

Write shell scripts in JavaScript and leverage the power of JavaScript’s simplicity and flexibility to make your shell scripting easier and faster. Why struggle with the complexity of Bash or other shell scripting languages when you already know JavaScript? Script.js allows you to write and run complex shell scripts using JavaScript, saving you time and reducing errors.

Show your ❤️ and support by starring this project and following the author, Guten Ye!

Stars NPM Version License PRs Welcome

🌟 Features

  • Fast to write: The most important factor in script writing is speed. With Script.js, you can quickly open the editor, write a few lines of code, and run it instantly. Thanks to global commands, you don’t need to worry about import statements, and more. Writing a script is enjoyable and efficient.
  • Fun to run: A major benefit of using a script is autocompletion. Script.js includes built-in autocompletion support. Running a script is fun and seamless.
  • JavaScript Power: Writing complex scripts in JavaScript and access the entire JavaScript ecosystem.
  • Familiar Syntax: Write your shell commands just like you would in Bash, with full support for redirection, pipes, environment variables, and more.
  • Subcommands: Create and organize subcommands effortlessly.
  • Help Documentation: Auto-generate command help documentation for better user experience.
  • Fast Execution: Fast to execute your scripts.

🚀 Getting Started

1️⃣ Install

First, make sure Bun and Carapace are installed.

To install Script.js, run:

npm install -g @gutenye/script.js

2️⃣ Write Your First Script

Create a file named hello.js and add the following code:

#!/usr/bin/env script.js

app
  .name('hello.js')
  .enableCompletion()

app.command('greetings [files...]')
  .completion({
    positionalany: ['$files'],
  })
  .action((files, options) => {
    $`
      ls -l ${files}
      echo ${files} | wc -l
    `
  })

3️⃣ Run the script

You can use <Tab> to autocomplete arguments or options while using the script.

chmod +x hello.js   # Make the script executable
./hello.js          # First run to create completion file
./hello.js <Tab>    # Use Tab key for autocompletion

📖 Documentation

🙇 Thanks

  • Bun: Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
  • Carapace: A multi-shell completion binary
  • Zurk: A generic process spawner
  • Zx: A tool for writing better scripts
  • Commander.js: node.js command-line interfaces made easy

🤝 Contribute

We love contributions! Whether you’re fixing bugs, adding features, or improving documentation, your involvement makes this project better.

How to Contribute:

  1. Fork the Repository
  2. Open a Pull Request on Github

Thank you for using Script.js! If you found it helpful, please ⭐️ star the project ️️⭐ on GitHub. If you have any questions, encounter issues, please refer to the documentation or report an issue on GitHub.

Special Thanks to All Contributors:

⬆ Back to top ⬆