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

@evdhiggins/automate-this

v0.0.3

Published

Broilerplate-providing automation module for Airtable projects

Downloads

1

Readme

Automate-This

Automate This is a module used to aid Airtable-based automation workflows.

This project is a bit experimental.

How

  1. Require the Automator and initialize a class with your Airtable credentials
  2. Declare any desired airtable filters
  3. Initialize a taskrunner by calling automator.forEachRow() and chain the desired combination of .do(), .doIf(), and(), and andIf() methods
  • do and doIf create a new Task Set. Each Task Set is executed after the proceeding Task Set.
  • and and andIf add a new Task (function) to the current Task Set. All Tasks in the same Task Set are executed in parallel (or as close to that as asynchronous single threaded node allows).
  1. Multiple taskRunners can be created by subsequently calling automator.forEachRow(), though they will be simply executed as additional Task Sets.
  2. Perform the defined actions by calling automator.run()

Example

const Automator = require("automate-this");

// airtable api key, base id, and table id
const options = {
  apiKey: process.env.AIRTABLE_API_KEY,
  baseId: process.env.AIRTABLE_BASE_ID,
  tableId: process.env.AIRTABLE_TABLE_ID,
};

const automator = new Automator(options);

// define a filter for the airtable rows
automator.filterRowsBy("Title", "=", "Hello World").and("Pages", ">=", 120);

automator.forEachRow().do((...args) => {
  // perform actions based on each airtable row
}).and((...args) => {
  // perform a second action at the same time as the first
}).then.do((...args) => {
  // perform a third action after the completion of the first two
});

// perform all previously defined steps
automator.run();

Task function example

//... automator class & filter defined
automator.forEachRow().do((row, nightmare, update) => {
  // each row object is a shallow copy of the original, so mutations won't be shared
  if(row.Title === "Some value") {
    row.Ordered = true;
  } else {
    row.Ordered = false;
  }
  // the update function changes the in-memory row values
  // these changes will be accessible by subsequent task sets (the next `do` call),
  //  but will not be shared within other tasks in the same group (added via `and` or `andIf`)
  update(row);
  // after all tasks sets have been performed, the automator will properly update all modified rows in Airtable
})

API

TODO

Why does this exist?

I wanted to create a system to simplify the broilerplate of various task automation projects that I was working on.

Why Nightmare.js?

Many of the tasks that I need to work with require dynamically interacting with Javascript-rendered web pages. I've found that Nightmare.js makes this very easy to do.