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

ai-dungeon-typescript-starter

v0.1.4

Published

A TypeScript starter for building AI Dungeon script packs with full type safety, modern build tooling, and ergonomic developer experience.

Readme

AI Dungeon Scripts Starter

A TypeScript starter for building AI Dungeon script packs with full type safety, modern build tooling, and ergonomic developer experience.

Getting Started

npx ai-dungeon-typescript-starter my-new-project

This command will create a new AI Dungeon TypeScript project in the my-new-project directory. Then, install dependencies and start developing your scripts.

cd my-new-project
npm install

Features

  • TypeScript-first: Write scripts in TypeScript for type safety and editor autocompletion.
  • Automatic SDK Helper Exports: Any helper you import in your scripts (e.g., deepFreeze from ai-dungeon-sdk) is automatically exported from library.ts for use in the AI Dungeon environment.
  • No manual export management: The build process ensures all needed exports are present and removes any redundant ones.
  • Modern ESM output: All code is bundled as ESM for compatibility with modern tools and the AI Dungeon scripting environment.
  • Portable: All build scripts and configs are local to this starter directory.

Project Structure

apps/ai-dungeon-typescript-starter/
├── src/
│   ├── context.ts   # Your context modifier script
│   ├── input.ts     # Your input modifier script
│   ├── output.ts    # Your output modifier script
│   └── library.ts   # All custom helpers and auto-exported SDK helpers
├── dist/            # Compiled JS output (ready for AI Dungeon)
├── scripts/   # Build automation scripts
├── rollup.config.mjs
├── package.json
└── ...

Usage

  1. Install dependencies:

    npm install
  2. Develop your scripts:

    • Write your logic in src/context.ts, src/input.ts, and src/output.ts.
    • Place any custom helpers in src/library.ts.
    • Import any helpers you need from ai-dungeon-sdk or other packages—no need to manually export them from library.ts.
  3. Build:

    npm run build

    This will:

    • Ensure all needed exports are present in library.ts (and remove redundant ones)
    • Compile TypeScript
    • Bundle all code (including SDK helpers) into ESM JS files in dist/
    • Post-process output for AI Dungeon compatibility
  4. Deploy:

    • Use the files in dist/ (context.js, input.js, output.js, library.js) in the AI Dungeon scripting environment.

How It Works

  • The build script scans your script files for all imports and ensures they are exported from library.ts.
  • All exports are bundled and inlined using Rollup, so library.js contains everything needed—no require or import statements.
  • The output scripts are ready to be copy-pasted or uploaded to AI Dungeon.

Example: Using SDK Helpers

// src/context.ts
import { deepFreeze } from 'ai-dungeon-sdk';

export function modifier({ text }) {
  return deepFreeze({ text: text.toUpperCase() });
}

You do not need to add export { deepFreeze } from 'ai-dungeon-sdk'; to library.ts—the build will do it for you.

Scripts

  • npm run build — Full build (auto-exports, compile, bundle, post-process)
  • npm run clean — Remove build output

Requirements

  • Node.js 18+
  • npm/pnpm/yarn for package management

License

MIT