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

@simplyworks/sw-serverless

v10.2.5

Published

Write SW-Serverless adapters in JavaScript or TypeScript: settings, commands, and the host protocol, with no dependencies.

Readme

@simplyworks/sw-serverless

Write SW-Serverless adapters in JavaScript or TypeScript, on Node 22 or later. No dependencies: Node's own http2 speaks the host's protocol — gRPC over a Unix socket — and the SDK carries the protobuf messages itself, so it vendors into an adapter package as plain files.

const sw = require("@simplyworks/sw-serverless");

class Greeter {
  static commands = {
    Greet: { method: "greet", input: "string", output: "string", description: "Greets someone" },
  };

  constructor() {
    sw.expect("Greeting", { default: "Hello", description: "What to say" });
    sw.expect("ApiKey", { secret: true });
  }

  greet(name) {
    return `${sw.valueOf("Greeting")}, ${name}`;
  }
}

sw.run(Greeter);
  • Settings are declared with sw.expect(name, { default, required, secret, description, type }) and read with sw.valueOf(name).
  • Commands are declared in static commands: the method that runs each, and its input and output — "string" (raw text), "bytes", "json", or a JSON Schema. Leave input out for a command with no argument, and output for one that returns nothing. Methods may be async.
  • Errors reach the caller with their type and message; throw new sw.AdapterError(message, { type: "Acme.Rejected" }) to choose the type.
  • Resident adapters have a start method and run until stopped, with optional stop, status and reset(sessionId). sw.context() publishes events, keeps small state and records metrics; its signal aborts when the host gives up on a call.
  • Logs go to the host with sw.log.info(...) and the other levels.
  • node main.js --describe prints what the adapter is; sw-serverless build writes it into the manifest.

An application with a contract of its own declares it on the adapter class with static kinds and static contracts ({ orders: 1 }), and can give its adapter authors base classes that do it for them. sw-serverless init --lang node (or typescript) starts an adapter. Tests: npm test.