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

@ivan-pasco/clean-node-server

v0.1.5

Published

Node.js host bridge for Clean Language WASM modules

Downloads

34

Readme

Clean Node Server

A Node.js runtime for Clean Language applications. Run your compiled Clean Language WebAssembly modules with full access to HTTP servers, databases, file systems, and more.

What is this?

Clean Node Server lets you run Clean Language .wasm files on any machine with Node.js. It provides all the "bridge functions" your Clean code needs to interact with the outside world - things like:

  • Starting a web server and handling HTTP requests
  • Connecting to PostgreSQL or SQLite databases
  • Reading and writing files
  • Making HTTP requests to other services
  • User authentication with sessions and JWT tokens
  • And much more!

Quick Start

Installation

npm install -g @ivan-pasco/clean-node-server

Or use it directly with npx:

npx @ivan-pasco/clean-node-server your-app.wasm

Running Your First App

Once you've compiled your Clean Language code to WebAssembly:

clean-node-server my-app.wasm

That's it! Your app is now running on http://localhost:3000

Common Options

# Run on a different port
clean-node-server my-app.wasm --port 8080

# Connect to a database
clean-node-server my-app.wasm --database "postgresql://user:pass@localhost/mydb"

# See what's happening under the hood
clean-node-server my-app.wasm --verbose

Documentation

| Guide | Description | |-------|-------------| | Getting Started | First steps with Clean Node Server | | HTTP Server | Building web APIs and handling requests | | Database | Working with PostgreSQL and SQLite | | Authentication | Sessions, passwords, and JWT tokens | | File System | Reading and writing files | | HTTP Client | Making requests to external services | | All Functions | Complete reference of available functions |

Command Line Options

| Option | Short | Default | What it does | |--------|-------|---------|--------------| | --port | -p | 3000 | Which port to listen on | | --host | -h | 0.0.0.0 | Which network interface to use | | --database | -d | none | Database connection URL | | --verbose | -v | off | Print detailed logs | | --session-secret | | auto | Secret for encrypting sessions | | --jwt-secret | | auto | Secret for signing JWT tokens | | --sandbox | | wasm dir | Root folder for file operations |

Database Connection URLs

PostgreSQL:

postgresql://username:password@hostname:5432/database_name

SQLite (file):

sqlite:///path/to/database.db

SQLite (in memory):

sqlite::memory:

Example: A Simple API

Here's what a Clean Language API might look like:

// Define a route that returns JSON
function handleHealth(): string {
    return _http_json('{"status": "ok", "message": "Server is running!"}')
}

// Set up the server
function main(): void {
    _http_route("GET", "/health", handleHealth)
    _http_listen(3000)
    print("Server started on port 3000")
}

Compile it and run:

clean-node-server my-api.wasm --verbose

Then visit http://localhost:3000/health to see your API in action!

Project Structure

src/
├── index.ts          # CLI - where it all starts
├── server.ts         # The Express HTTP server
├── bridge/           # All the functions your Clean code can call
│   ├── console.ts    # print, printl, etc.
│   ├── http-server.ts# Routes and responses
│   ├── request.ts    # Reading request data
│   ├── database.ts   # SQL queries
│   ├── auth.ts       # Authentication helpers
│   ├── crypto.ts     # Encryption and hashing
│   ├── file.ts       # File operations
│   └── ...more
├── wasm/             # WebAssembly loading and management
├── router/           # Route matching logic
├── session/          # Session storage
└── database/         # Database drivers

Development

Want to contribute or run from source?

# Clone the repo
git clone https://github.com/Ivan-Pasco/clean-node-server.git
cd clean-node-server

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Try it out
npm run dev -- path/to/your-app.wasm --verbose

Requirements

  • Node.js 18 or later
  • Your compiled Clean Language .wasm files

License

MIT - Use it however you like!

Links