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

mint-compiler

v0.2.0

Published

A toolchain for compiling multiple JavaScript modules into a single TurboWarp extension

Downloads

70

Readme

Mint Compiler

A toolchain for compiling multiple JavaScript modules into a single, highly readable TurboWarp extension.

Features

  • Modular Development: Write your extension across multiple files
  • Tree-Shaking: Automatically removes unused exports
  • Auto-Class Generation: Converts module functions into a TurboWarp extension
  • Metadata Headers: Generates documentation headers from your manifest
  • Git Integration: Automatically includes repository URL in output
  • Prettier Formatting: Produces clean, consistent output

Installation

npm install mint-compiler --save-dev

Or use directly with npx:

npx mint-compiler init
npx mint-compiler build

Usage

Initialize a New Project

mint-compiler init

This creates a src/ directory with:

  • 99-manifest.json - Extension metadata (JSONC format)
  • 00-index.js - Entry point with getInfo() function
  • 01-hello-world.js - Example module with exported functions

Build Your Extension

mint-compiler build

Compiles your extension to dist/<id>@<version>.js.

Project Structure

your-extension/
├── src/
│   ├── 99-manifest.json    # Extension metadata
│   ├── 00-index.js         # Entry point (imports + getInfo)
│   └── 01-*.js             # Additional modules
├── dist/                   # Compiled output
└── package.json

Manifest Format

The 99-manifest.json file supports JSONC (JSON with comments):

{
  // PascalCase class name for the extension
  "class": "MyExtension",

  // Display name shown in Scratch
  "name": "My Extension",

  // Unique identifier
  "id": "myextension",

  // SPDX license identifier
  "license": "MIT",

  // Current authors
  "authors": [{ "name": "Your Name", "url": "https://example.com" }],

  // Original authors (if forked)
  "originalAuthors": [],

  // Description
  "description": "What your extension does",

  // Semantic version
  "version": "1.0.0",
}

Entry Point Format

Your 00-index.js should define a getInfo() function and import modules:

import { myBlock } from "./01-my-module.js";

function getInfo() {
  return {
    id: "myextension",
    name: "My Extension",
    blocks: [
      {
        opcode: "myBlock",
        blockType: Scratch.BlockType.REPORTER,
        text: "My Block",
      },
    ],
  };
}

Module Format

Additional modules export functions that become class methods:

export function myBlock() {
  return "Hello World!";
}

// This function is never imported, so it's removed
export function unusedFunction() {
  return "This won't appear in the output";
}

How It Works

  1. Parse Manifest: Reads metadata from 99-manifest.json
  2. Extract Functions: Identifies all functions from entry point and imports
  3. Tree-Shake: Removes exports that are never imported
  4. Generate Class: Wraps functions in a class with your manifest's class name
  5. Add Header: Prepends metadata comments (name, ID, authors, license, etc.)
  6. Wrap IIFE: Formats in TurboWarp's required IIFE format
  7. Format: Runs Prettier for consistent output
  8. Output: Writes to dist/<id>@<version>.js

Development

Scripts

npm run lint          # Run ESLint
npm run lint:fix      # Run ESLint with auto-fix
npm run format        # Format code with Prettier
npm run format:check  # Check formatting
npm test              # Run tests