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

@axpo/sdk

v1.0.0

Published

Core SDK for Acode plugin development

Readme

Runtime SDK and types for Acode plugin development. Part of the Axpo ecosystem.


Installation

npm install @axpo/sdk

Quick Start

import { useContext, useSettings } from 'axpo/sdk';

export default function myPlugin() {
  return {
    async init() {
      const { baseUrl, page, pluginId, firstInit } = useContext();
      const settings = useSettings<MySettings>();

      console.log(settings.get('theme'));

      if (firstInit) {
        console.log('First run!');
      }
    },

    async destroy() {
      // cleanup
    },

    settings: [
      {
        key: 'theme',
        text: 'Color Theme',
        type: 'select',
        defaultValue: 'dark',
        options: [['light', 'Light'], ['dark', 'Dark']],
        onChange(value) { applyTheme(value); }
      },
      {
        key: 'fontSize',
        text: 'Font Size',
        type: 'number',
        defaultValue: 14,
        info: 'Size in pixels'
      },
      {
        key: 'enabled',
        text: 'Enable Plugin',
        type: 'checkbox',
        defaultValue: true
      }
    ]
  };
}

Hooks

useContext()

Access the plugin runtime context. Must be called inside init() or destroy() only.

| Property | Type | Description | |----------|------|-------------| | baseUrl | string | Plugin base URL (with trailing slash) | | page | WCPage | Page/UI manager | | pluginId | string | Unique plugin ID | | firstInit | boolean | First time running? | | cacheFile | File | Cache file object | | cacheFileUrl | string | Cache file URL |

useSettings<T>()

Type-safe settings manager. Pass your settings interface as a generic to get full IntelliSense.

| Method | Description | |--------|-------------| | get(key) | Get a single setting value | | getAll() | Get all settings as an object | | set(key, value) | Update a value (triggers onChange) |

Settings

Settings are automatically rendered in Acode's settings UI.

| Type | UI | Value type | |------|----|------------| | checkbox | Toggle | boolean | | text | Text input | string | | number | Number input | number | | select | Dropdown | string |

| Property | Required | Description | |----------|----------|-------------| | key | ✅ | Unique identifier | | text | ✅ | Display label | | type | ✅ | checkbox | text | number | select | | defaultValue | ✅ | Initial value | | info | — | Help text shown below the setting | | icon | — | Icon name | | iconColor | — | Icon color (hex or rgba) | | options | — | For select: [value, label] pairs or plain values | | placeholder | — | For text / number inputs | | required | — | Marks field as required | | match | — | RegExp validation | | test | — | Custom validation (value) => boolean | | onChange | — | Called when value changes (value) => void |

All setting options:

{
  key: string           // required — unique key
  text: string          // required — display label
  type: SettingType     // required — checkbox | text | number | select
  defaultValue: any     // required — default value
  info?: string         // help text
  icon?: string         // icon name
  iconColor?: string    // hex or rgba
  options?: Array<[string, string] | string>  // for select type
  placeholder?: string  // input placeholder
  required?: boolean    
  match?: RegExp        // validation pattern
  test?: (value) => boolean  // custom validation
  onChange?: (value) => void // on change handler
}

Project Structure

After initialization, your project will have this structure:

my-plugin/
├── src/
│   └── main.ts          # Plugin entry point
├── plugin.json          # Plugin manifest
├── axpo.config.ts       # Build configuration
├── tsconfig.json        # TypeScript config
├── package.json
├── readme.md
├── icon.png             # Plugin icon (max 50KB)
└── .gitignore

Configuration

// axpo.config.ts
import { defineConfig } from '@axpo/sdk';

export default defineConfig({
  buildOptions: {
    entryPoints: ['src/main.ts'],
    bundle: true,
    minify: false,
    target: 'es2020',
    alias: { '@': './src' }
  },
  files: ['readme.md', 'icon.png'],
  zipFilename: 'MyPlugin.zip',
  dev: { port: 3000 }
});

plugin.json

{
  "id": "com.example.plugin",
  "name": "Example Plugin",
  "main": "dist/main.js",
  "version": "1.0.0",
  "readme": "readme.md",
  "icon": "icon.png",
  "files": ["worker.js"],
  "minVersionCode": 292,
  "price": 0,
  "license": "MIT",
  "keywords": ["foo","bar"],
  "changelogs": "changelogs.md",
  "author": {
    "name": "Example Author",
    "email": "[email protected]",
    "url": "https://example.com",
    "github": "example"
  }
}

Links