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

simple-run-scripts-cycle

v0.0.1

Published

Scripts cyclic runner with interval

Readme

simple-run-scripts-cycle

Js and shell scripts cyclic runner with interval. Usable for replacing cron, or making processes from scripts.

Package contains cli tools and exports runner class.

CLI

Run bash script

For example we have bash script in root dir ./test.sh

# ./test.sh file
echo "Hello from sh!"

Next npm script will run it cyclic with 2 secs interval

npm run simple-run-script-cycle --script ./test.sh --delayMs 2000 --maxDurationMs 5000 --pathStrategy fromClosestPackageJsonFile

(You may try to use it with npx or add this script to scripts section of your package.json)

Run node script

For example we have js script ./js/test/test.js

//./js/test/test.js
console.log("Hello from js script!");

Next npm script will run it cyclic with 2 secs interval

npm run simple-run-js-cycle --script ./js/test/test.js --delayMs 2000 --maxDurationMs 5000 --pathStrategy fromClosestPackageJsonFile

CLI params

  • {name: "script", type: String, multiple: true, reuqired: true} - absolute or relative path to script
  • {name: "delayMs", type: Number} - min delay between execuitions in milliseconds
  • {name: "maxDurationMs", type: Number} - max available duration of every script execution before cold reset
  • {name: "pathStrategy", type: String} - one of available path strategies (more next..)
  • {name: "console", type: String} - path to js file, exports only one function type of (...s) => void for logging. Default will use console.log.

Path strategies

Available 3 strategies to resolve relative paths:

  • none - don't process relative paths (default option)
  • fromScriptRoot - resolve relative paths from parent running scripts root
  • fromClosestPackageJsonFile - found parent running scripts root and moving top by directories before found package.json file. Using this directory as a root.

Runner class

export type SimpleRunScriptsCycleConfig = {
    scriptsAndOpts: string[];
    delayMs: number;
    maxDurationMs: number;
    relativePathStrategy: PathProcessStrategy;
};
export declare class SimpleRunScriptsCycle {
    config: SimpleRunScriptsCycleConfig;
    constructor(config: SimpleRunScriptsCycleConfig, logFn?: ((...a: any[]) => void) | null);
    run(): void;
    stop(): void;
}

Author

Anatoly Starodubtsev [email protected] https://t.me/pantagruel74

LICENSE

MIT