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 🙏

© 2024 – Pkg Stats / Ryan Hefner

choreographic

v1.0.6

Published

Simple framework for single-run scripts.

Downloads

155

Readme

Choreographic

Prepackaged application services and behaviors for single-run scripts. Services provided by fable. The key elements:

  • settings/configuratin
  • logging
  • reading files of common formats (csv, text)
  • writing files to the execution-specific rundata folder

Specifically, I kept writing a bunch of these one-off scripts that do tasks like importing a set of data. Or mutating a set of records. Or exercising a set of endpoints. And at times, had to pull in data multiple iterations or on different servers.

When using traditional application services for this, it can be rough. If I were to, say, import 50,000 records and wanted to log anomalies as well as some surrounding data. And, there are 20,000 anomalies.

After running the thing a bunch of times, the log file is fricken enormous. And if I'm running it against qa, staging and production based on shifting config it gets even trickier.

Using This Thing

So you want to Choreograph something:

1. Install the Package:

~/Code/someawesomescript: npm i --save choreographic

2. Write Your Awesome Script:

const libChoreographic = require('choreographic');

const _ScriptHost = new libChoreographic({ "ImportantSettingValue":"I am an important setting!" });

_ScriptHost.log.info('My script is running!');

// Do some important stuff
_ScriptHost.log.error(`There are settings like [ImportantSettingsValue] you can use [${_ScriptHost.settings.ImportantSettingValue}].`);

3. Run Your Awesome Script:

~/Code/someawesomescript: node index.js
2023-04-24T23:43:31.849Z [info] (ScriptHost): Starting up script host [/Users/steven/Code/someawesomescript/rundata/ScriptHost-Run-2023-04-24-16-43-31-833/ScriptHost-Run-2023-04-24-16-43-31-833.log] for ScriptHost...
2023-04-24T23:43:31.855Z [info] (ScriptHost): My script is running!
2023-04-24T23:43:31.855Z [error] (ScriptHost): There are settings like [ImportantSettingsValue] you can use [I am an important setting!].

~/Code/someawesomescript:

4. But Wait, There's More!

After running the script, there will also be a rundata folder:

~/Code/someawesomescript: ls -l rundata/
drwxr-xr-x  3 steven  staff  96 Apr 24 16:42 ScriptHost-Run-2023-04-24-16-42-11-581
drwxr-xr-x  3 steven  staff  96 Apr 24 16:42 ScriptHost-Run-2023-04-24-16-42-31-419
drwxr-xr-x  3 steven  staff  96 Apr 24 16:43 ScriptHost-Run-2023-04-24-16-43-31-833

And in this case the script has been run three times. There is a log file in each folder. Each time you execute the script, it has a new folder for itself.

If you want the prefix to not be ScriptHost, it just uses the common fable settings format for application name:

{
	"Product": "MyProductName"
}

Documentation Yet to Write

  • read common format files
  • write a file to the current rundata folder