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

mini-workflow

v0.0.0

Published

This is a mini Temporal-like workflow engine for TypeScript implemented with pluggable backends for AWS (CloudFlare coming soon).

Downloads

13

Readme

mini-workflow (name subject to change)

This is a mini Temporal-like workflow engine for TypeScript implemented with pluggable backends for AWS (CloudFlare coming soon).

[!CAUTION] The code was build in a day and is not fully tested. The e2e example works, but there may be bugs.

Why

It was built in response to Dax's relentless begging for a simple workflow engine that can run on AWS:

please someone build a workflow engine as a library that can be backed by various stores

i am telling you this will become one of the most used packages ever - it eliminates the need for so much

  • https://x.com/thdxr/status/1840858283168710884

Also, because durable workflow orchestration is a powerful primitive for event-driven systems and can be trivially implemented with AWS Lambda, S3, SQS and Event Bridge.

Example

Usage

SST Config

const engine = new WorkflowEngine("WorkflowEngine", {
  worker: "example/index.execute",
  orchestrator: "example/index.orchestrate",
});

App Code

import { workflow } from "mini-workflow";

// a workflow is implemented as a simple function accepting context and arbitrary parameters
export const uploadObjectWorkflow = workflow(
  "uploadObjectWorkflow",
  async (ctx, key: string, data: string) => {
    // ctx.sleep will sleep (pause the workflow) for 1 second
    await ctx.sleep(1);

    // ctx.task will asynchronously (and durably, with at-least-once delivery) run the provided function in the worker Lambda Function
    await ctx.task(async () => {
      await s3Client.send(
        new PutObjectCommand({
          Bucket: bucketName,
          Key: key,
          Body: data,
        })
      );
    });

    const response = await ctx.task(async () => {
      const response = await s3Client.send(
        new GetObjectCommand({
          Bucket: bucketName,
          Key: key,
        })
      );

      return response.Body?.transformToString() ?? "";
    });

    return response;
  }
);