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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@thegrotesk/scripterra

v1.0.8

Published

Script engine for your server

Readme

------------------------------------------------------------------
  _________            .__        __
 /   _____/ ___________|__|______/  |_  _______________________
 \_____  \_/ ___\_  __ \  \____ \   __\/ __ \_  __ \_  __ \__  \
 /        \  \___|  | \/  |  |_> >  | \  ___/|  | \/|  | \// __ \_
/_______  /\___  >__|  |__|   __/|__|  \___  >__|   |__|  (____  /
        \/     \/         |__|             \/                  \/
-------------------------------------------------------------------

Powerful script engine for Node.js

🏠 Homepage

🧑‍🏫 Motivation

  • What about the dependencies?

  • What about the dubbing of the code?

  • What about the logs?

  • What if you have many projects that require one script but different configs for it?

🌟 Features

  • Pretty CLI
  • Multiple env files for one scripts
  • Schedules
  • Custom detached worker
  • Logs
  • Easy to use

⚓ Requirments

⚙️ Install

npm i -g @thegrotesk/scripterra

📌 Quick Guide

You can list all available flags by typing this command:

scripterra --help

Step 1. Init project

Create a project directory and initialize the npm.

mkdir ./my-scripterra-project
cd ./my-scripterra-project
npm init -y

Once it completed, let's create scripterra config file!

scripterra --create config

Your project structure should look like this example:

-my-scripterra-project
|__ .scripterra
|__ package.json
|__ package-lock.json

Step 2. Configure

Open .scripterra file. You should see this template:

SCRIPTS_PATH=./scripts/
ENV_PATH=./env/
REDIS=redis://localhost:6379
LOG_PATH=./logs/

You can change configuration if you want.

SCRIPTS_PATH - define the folder in which you want to store scripts

ENV_PATH - define the folder in which you want to store environment files

REDIS - define redis connection string

LOG_PATH - define the folder in which Scripterra Worker will store the logs

Step 3. Create script

scripterra --create script --name Test

Scripterra will automaticaly create SCRIPTS_PATH folder and store Test.js there.

Step 4. Run script

You can run script with different env files from your ENV_PATH.

Let's create one.

nano ./env/.test

And create some values. For example:

HELLO_STRING=Hello world!

Now open Test.js and log this value. All env values stored in process.env

import { Script } from '@thegrotesk/scripterra';

//Generated by Scripterra.
export class Test extends Script {
    constructor(console, args) {
        super(console, args);
    }

    async main() {
        this.console.consoleInfo(process.env.HELLO_STRING);
    }
}

Now, we can run the script.

scripterra --run Test --env .test

You should see this in your terminal:

------------------------------------------------------------------
  _________            .__        __
 /   _____/ ___________|__|______/  |_  _______________________
 \_____  \_/ ___\_  __ \  \____ \   __\/ __ \_  __ \_  __ \__  \
 /        \  \___|  | \/  |  |_> >  | \  ___/|  | \/|  | \// __ \_
/_______  /\___  >__|  |__|   __/|__|  \___  >__|   |__|  (____  /
        \/     \/         |__|             \/                  \/
-------------------------------------------------------------------
Welcome to Scripterra! Pass --help for more information.

[ 2022-08-12T10:44:37.206Z ]
Info |  Current .scripterra config:
[ 2022-08-12T10:44:37.206Z ]
┌──────────────┬──────────────────────────┐
│   (index)    │          Values          │
├──────────────┼──────────────────────────┤
│ SCRIPTS_PATH │       './scripts/'       │
│   ENV_PATH   │         './env/'         │
│    REDIS     │ 'redis://localhost:6379' │
│   LOG_PATH   │        './logs/'         │
└──────────────┴──────────────────────────┘
[ 2022-08-12T10:44:37.217Z ]
Info |  Compile script...
[Test.js] | Info | Starting...
[Test.js] | Info | Hello world!
[Test.js] | Info | Finished.

Step 5. Schedule script

You can schedule your scripts. Be shure that your redis server is working!

scripterra --schedule Test --env .test --expression '* * * * *'

Check if you schedule was created.

scripterra --listall

You should see this:

Info |  List of all schedules:
[ 2022-08-12T10:49:15.474Z ]
┌─────────┬────────┬─────────┬─────────────┬─────────────────┐
│ (index) │ script │   env   │ expression  │ serialized_task │
├─────────┼────────┼─────────┼─────────────┼─────────────────┤
│    0    │ 'Test' │ '.test' │ '* * * * *' │       ''        │
└─────────┴────────┴─────────┴─────────────┴─────────────────┘

To update schedule cron expression, just type the same command as for creation and update expression string

scripterra --schedule Test --env .test --expresion '10 * * * *'

You should see this message:

Warning | This script and env already scheduled. Updating schedule...

Now, we can launch the scripterra worker to process the jobs.

scripterra -w

Or, you can run worker in detach mode

scripterra -w -D

You should see this:

Info |  Detached worker was started with pid 25052

To stop worker you need to kill the process with pid 25052.

Worker will write logs in LOG_PATH. All logs sorted by pid.

-/logs
|__ scripterra.pid-25052.log

Step 6. Delete the script or schedule

If you want to delete your script. Type:

scripterra --delete script --name Test

If you want to delete your schedule. Type:

scripterra --delete schedule --name Test --env .test

Warning! To delete schedule you need to specify --env flag. Otherwise all schedules for this script will be deleted.

Enjoy!

🧾 Documantation

Run tests

npm run test

Author

👤 Alexander Poberezhnyi

🤝 Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2021 Alexander Poberezhnyi. This project is GPL--3.0--or--later licensed.