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

duwende

v0.1.0-beta.9

Published

A flexible server framework with dynamic resource loading

Readme

DUWENDE: Dynamic Unified Web-Enabled Network Development Engine

An ultra-lightweight, flexible and extensible web application nano-framework built with Bun.

Prerequisites

Installation

Recommended Method

The recommended way to get started is by cloning the duwende-starter repository, which includes pre-made tools and a simple server setup:

# Clone the starter repository
git clone https://github.com/tenxd/duwende-starter.git my-project
cd my-project

# Install dependencies
bun install

# Start the server
bun run index.js

Manual Installation

Alternatively, you can set up a project manually:

# First, install Bun if you haven't already
curl -fsSL https://bun.sh/install | bash

# Create a new Bun project
bun init

# Then install duwende
bun install duwende

# Initialize your project
bunx duwende init

# Start the server
bun run index.js

CLI Commands

The package provides several CLI commands to help you get started and create new components:

# Initialize a new project
bunx duwende init

# Create a new resource
bunx duwende resource <name> <service> [hostname]

# Create a new tool
bunx duwende tool <name>

# List installed tools
bunx duwende tools

Key Concepts

Resource-Oriented Architecture (ROA)

Duwende follows a strict resource-oriented architecture where everything is modeled as a resource (noun) rather than actions (verbs). For example:

  • Instead of a "login" endpoint, you create a "login" resource:
    • POST /login (create a login session)
    • DELETE /login (logout/destroy session)
  • Resources map naturally to REST operations:
    • GET: Retrieve a resource
    • LIST: Special method for retrieving collections (GET without ID)
    • POST: Create a new resource
      • Without ID: Create a new standalone resource
      • With ID: Create a new resource derived from an existing one (parent or peer)
    • PUT: Replace a resource
    • PATCH: Update a resource
    • DELETE: Remove a resource

Resources

  • Handle specific types of requests and render responses
  • Must be pure in their implementation - no external imports allowed
  • Any interaction with the outside world (databases, files, APIs) must be done through Tools
  • Resources are automatically loaded and managed by the server
  • Each resource can implement two types of methods for each HTTP operation:
    • handleXXX(): For API responses, returns JSON data (Content-Type: application/json)
    • renderXXX(): For HTML responses, returns rendered content (Content-Type: text/html)
    • The appropriate method is called based on the Accept header in the request

Example:

class UserResource extends Resource {
  // API endpoint: returns JSON
  async handleGet(request, id, path) {
    return new Response(JSON.stringify({
      id: id,
      name: "John Doe"
    }), {
      headers: { 'Content-Type': 'application/json' }
    });
  }

  // Web endpoint: returns HTML
  async renderGet(request, id, path) {
    return new Response(`
      <html>
        <body>
          <h1>User Profile</h1>
          <p>ID: ${id}</p>
          <p>Name: John Doe</p>
        </body>
      </html>
    `, {
      headers: { 'Content-Type': 'text/html' }
    });
  }
}

Tools

  • Provide reusable functionality for resources
  • Handle all external interactions (database connections, file operations, API calls)
  • Are loaded at server startup and made available to resources
  • Must implement specific schemas for initialization, input, and output

Server

  • Core server implementation that handles request routing and resource management
  • Strictly follows REST principles with added LIST method
  • Manages resource lifecycle and configuration
  • Handles tool loading and initialization

Configuration

The server uses a config.json file for configuration with two main sections:

{
  "global": {
    "resourcePath": "optional/custom/path/to/resources/${service}/${name}.js"
  },
  "resources": {
    "resource-name": {
      // Resource-specific configuration
    }
  }
}
  • global: Contains settings that apply to all resources
    • resourcePath: Optional template string for custom resource file locations
  • resources: Contains resource-specific configurations
    • Each resource can have its own configuration object
    • Global config is automatically made available to resources

About

This project uses Bun, a fast all-in-one JavaScript runtime. Bun is required to run this framework.

License

MIT © Ten X Development Corporation