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

suga

v0.2.0

Published

The Suga Programming Language - A modern language that compiles to JavaScript, powered by Bun

Readme

Suga Programming Language

Suga is a programming language that transpiles to TypeScript and runs on the Bun runtime.

Features

  • Custom Syntax: Use fn instead of function
  • TypeScript Output: Compiles to clean TypeScript code
  • Bun Integration: Direct support for running .suga files with Bun
  • Simple & Fast: Lightweight parser and transformer

Installation

npm install
npm run build

Usage

CLI

# Run a Suga file directly
bun run src/cli.ts hello.suga

# Or after building
suga hello.suga

# Compile to TypeScript
goku compile hello.goku > hello.ts

Example Goku Code

fn greet(name) {
  return "Hello, " + name
}

let message = greet("World")
console.log(message)

This compiles to:

function greet(name) {
  return "Hello, " + name;
}
let message = greet("World");
console.log(message);

Using with Bun Loader

You can register the Goku loader in your bunfig.toml:

[loaders]
".goku" = "./node_modules/goku/dist/bun-loader.js"

Then you can import .goku files directly:

import "./my-module.goku";

Or use the plugin API:

import { plugin } from "bun";
import gokuLoader from "goku/bun-loader";

plugin(gokuLoader);

// Now you can import .goku files
import "./app.goku";

Language Syntax

Functions

fn add(a, b) {
  return a + b
}

async fn fetchData() {
  // async functions supported
}

Variables

let x = 10
init name = "Goku"      // 'init' replaces 'const' - unified initialization
var mutable = true      // 'var' behaves like 'let' (block-scoped)

Note:

  • init replaces const and provides unified initialization syntax for all types
  • var behaves exactly like let - block-scoped, no hoisting quirks
  • See VAR-VS-LET.md and INIT-AND-PUB-FN.md for details

Encapsulation with pub fn

fn Shop() {
  pub fn checkout() {
    console.log("Checking out...")
  }

  pub fn addItem(item) {
    console.log("Adding item:", item)
  }
}

init myshop = Shop()  // Factory pattern - no 'new' needed!
myshop.checkout()

Functions with pub fn methods compile to factory functions that return objects. This is the functional approach - simpler and cleaner than classes. See INIT-AND-PUB-FN.md for details.

Expressions

let sum = 1 + 2 * 3
let isTrue = x > 0 && y < 10
let message = "Hello" + " " + "World"

Development

# Build
npm run build

# Watch mode
npm run watch

# Run CLI in dev mode
npm run dev hello.goku

Architecture

  • Parser (src/parser.ts): Parses Goku syntax into an AST
  • Transformer (src/transformer.ts): Transforms AST to TypeScript
  • Compiler (src/compiler.ts): Main compilation interface
  • Bun Loader (src/bun-loader.ts): Bun plugin for .goku files
  • CLI (src/cli.ts): Command-line interface

Roadmap

  • [ ] Type annotations
  • [ ] Classes and objects
  • [ ] Imports/exports
  • [ ] More operators
  • [ ] Control flow (if/else, loops)
  • [ ] Error handling
  • [ ] Standard library

License

ISC