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

apify-actor-config

v2.0.0

Published

Type-safe Apify Actor config. Full autocomplete, compile-time validation.

Readme

apify-actor-config

Type-safe Apify Actor config. Full autocomplete, compile-time validation.

Apify Actors need an actor.json that defines metadata, input schemas, and output schemas. The input schema alone has 6 field types, 18 input fields, and dozens of type-specific properties.

One typo and your Actor breaks at deploy time with no useful error.

Apify doesn't publish official types for this. apify-actor-config fills the gap.

Write Actor config in .ts, get full autocomplete, catch mistakes at compile time, and generate actor.json from it.

npm install apify-actor-config

Quick start

Define your Apify actor.json config in TypeScript. This file can live anywhere and have any name.

// config.ts
import {
  createActorConfig,
  createActorInputSchema,
  createStringField,
  createObjectField,
} from 'apify-actor-config';

// Define actor inputs
const inputSchema = createActorInputSchema({
  schemaVersion: 1,
  title: 'My Scraper',
  type: 'object',
  properties: {
    startUrl: createStringField({
      title: 'Start URL',
      type: 'string',
      description: 'URL to start scraping from',
      editor: 'textfield',
      example: 'https://example.com',
    }),
    proxy: createObjectField({
      title: 'Proxy configuration',
      type: 'object',
      description: 'Select proxies to be used.',
      editor: 'proxy',
      sectionCaption: 'Proxy',
    }),
  },
});

// Define actor
export default createActorConfig({
  actorSpecification: 1,
  name: 'my-scraper',
  version: '0.1',
  input: inputSchema,
});

Compile it to JS, then point the CLI at the compiled output:

npx apify-actor-config gen --config ./dist/config.js

This generates an actor.json file inside .actor/.

If there is no ./actor/ directory, the file is saved to ./actor.json.

Why apify-actor-config?

Autocomplete for every field, editor, and property.

No more guessing which editors are valid for array fields, or what datepicker requires. Your IDE tells you.

Catch errors before deploy.

A misspelled "editor": "textfeild" fails the compiler, not your production Actor.

Field-specific types.

Available properties and their types depend on the type of the field. StringField expects different values than ArrayField. The compiler rejects anything else.

One source of truth.

Write config in TypeScript. Generate actor.json from it. No manual sync, no drift.

Before and after

With apify-actor-config:

import { createActorConfig, createActorInputSchema, createStringField } from 'apify-actor-config';

export default createActorConfig({
  actorSpecification: 1,
  name: 'my-scraper',
  version: '0.1',
  input: createActorInputSchema({
    schemaVersion: 1,
    title: 'My Scraper',
    type: 'object',
    properties: {
      startUrl: createStringField({
        title: 'Start URL',
        type: 'string',
        description: 'URL to start scraping from',
        editor: 'textfield', // ← autocomplete shows all valid editors
        pattern: '^https://',
        errorMessage: { pattern: 'URL must start with https://' },
      }),
    },
  }),
});

Without (hand-written actor.json):

{
  "actorSpecification": 1,
  "name": "my-scraper",
  "version": "0.1",
  "input": {
    "schemaVersion": 1,
    "title": "My Scraper",
    "type": "object",
    "properties": {
      "startUrl": {
        "title": "Start URL",
        "type": "string",
        "description": "URL to start scraping from",
        "editor": "textfeild",
        "pattern": "^https://",
        "errorMessage": { "patttern": "URL must start with https://" }
      }
    }
  }
}

Spot the two typos? Your users will -- at runtime. TypeScript catches both at compile time.

CLI

npx apify-actor-config gen --config ./dist/config.js

gen

Generate actor.json from a compiled JS config module.

| Flag | Required | Description | | ---------------------- | -------- | -------------------------------------------------------------------------------------- | | -c, --config <path> | Yes | Path to the compiled JS config file. | | -o, --out-dir [path] | No | Output directory. Defaults to .actor/ if it exists, otherwise the current directory. | | -s, --silent | No | Suppress log output. |

Documentation

| Document | Description | | ----------------------------------------- | ----------------------------------- | | API reference | Auto-generated TypeScript API docs. | | Changelog | Release history. |

License

MIT