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

seekapi

v2.0.1

Published

SDK for SeekAPI workers: getInput, charge, pushData/pushFile, run(), success/failure.

Readme

SeekAPI Node.js SDK

SDK for building SeekAPI workers in Node.js (Lambda). Handles input (fetch from presigned URL) and output (push JSON and files), charge (per-event billing), with a minimal Lambda return contract.

  • Zero dependencies — uses only Node built-ins.
  • Node 18+ — works in AWS Lambda runtimes.

Install

npm install seekapi

Quick start (recommended)

Use run() so the SDK handles input, output, and errors. You only implement a function from input → output:

const { run } = require("seekapi");

exports.handler = async (event, context) =>
  run(event, context, (input) => ({
    message: `hello ${input.name || "world"}`,
  }));

Async worker:

const { run } = require("seekapi");

exports.handler = (event, context) =>
  run(event, context, async (input) => {
    const data = await fetchSomething(input.url);
    return { count: data.length };
  });

Low-level API

When you need more control (e.g. multiple pushData calls, pushFile, or charge):

const {
  getInput,
  createContext,
  pushData,
  pushFile,
  registerRequestId,
  charge,
  success,
  failure,
} = require("seekapi");

exports.handler = async (event, context) => {
  const requestId = context && context.awsRequestId;
  const jobUuid = (event.job_uuid || "").trim();
  if (requestId && jobUuid) registerRequestId(jobUuid, requestId);

  const ctx = createContext(event);
  try {
    const inputData = await getInput(event);
    await pushData(ctx, { result: "ok" });
    return success(requestId);
  } catch (e) {
    return failure("WORKER_ERROR", e.message || String(e), requestId);
  }
};

API reference

| Function | Description | |----------|-------------| | getInput(event, timeoutOrOpts?) | Promise: fetch and parse job input JSON from event.input_presigned_url. Second arg: timeout in seconds (default 10), or { timeout: seconds }. Rejects with MissingInputError if URL missing; otherwise Error on HTTP/timeout/JSON errors. | | createContext(event) | Build context object for pushData / pushFile / charge: job_uuid, execution_token, api_base, secret (same shape as the Python SDK). | | charge(context, idempotencyKey, count?, timeoutSeconds?, justification?) | Promise: record metered billing units (per_event). Returns parsed API JSON. Rejects if context is incomplete or HTTP error. | | pushData(context, data, type?, timeoutSeconds?) | Promise: append JSON to the job (type default "json"; default timeout 8 seconds). No-op if env/context incomplete. | | pushFile(context, name, localPath, contentType?, timeoutSeconds?) | Promise: push a file to the job temp files (default timeout 15 seconds). | | registerRequestId(jobUuid, requestId, timeoutSeconds?) | Register Lambda request_id for live logs (no-op if env not set; default timeout 3 seconds). | | success(requestId?) | Return { ok: true, request_id? }. | | failure(code, message, requestId?) | Return { ok: false, error: { code, message }, request_id? }. | | run(event, context, userFn) | Promise: getInputuserFn(input)pushDatasuccess; on error → failure. Caps network timeouts to remaining Lambda time (same behavior as the Python SDK). |

Aliases (same as Python names): get_input, create_context, register_request_id, push_data, push_file.

Environment (set by the platform)

  • WORKER_API_BASE_URL — backend base URL for push, charge, and registerRequestId.
  • WORKER_INTERNAL_SECRET — secret for internal API auth.

In production, WORKER_API_BASE_URL should target https://api.seek-api.com (injected automatically by the SeekAPI deployment flow).

Errors

  • MissingInputErrorevent has no input_presigned_url (subclass of Error).
  • Error — input fetch failed (HTTP, timeout, invalid JSON); message is descriptive.

Publishing to npm

From the package directory:

npm version patch   # or minor/major
npm publish

Ensure you are logged in (npm login) and the package name is available on npm.

Migration from 1.x

  • createContext retourne désormais les clés job_uuid, execution_token, api_base, secret (comme le SDK Python), et non plus jobUuid / apiBase en camelCase.
  • getInput : le délai est exprimé en secondes (défaut 10), plus en millisecondes.
  • successWithOutput a été retiré (non présent dans le SDK Python) ; enchaînez await pushData(ctx, data) puis return success(requestId).