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 🙏

© 2025 – Pkg Stats / Ryan Hefner

weweb-backend-core

v0.1.0

Published

WeWeb Backend Core - Framework for building backend workflows in WeWeb

Readme

WeWeb Backend Core

A Node.js-based backend service framework for WeWeb, supporting integration with external services like OpenAI and Supabase.

Features

  • Backend service framework for WeWeb applications
  • Support for integrations with external services (OpenAI, Supabase)
  • Flexible workflow configuration
  • Middleware support
  • Input validation and mapping
  • Testing with Vitest

Project Structure

  • Uses Node.js runtime
  • Organized as a pnpm workspace
  • Two main packages: backend-core and openai
  • Uses Vite for building and bundling

Packages

backend-core

Core library for building and serving backend workflows:

  • API route handling and serving
  • Security configuration with access rule handling
  • Request validation and input mapping
  • Integration with external services via pluggable integrations
  • Error handling and response formatting

openai

OpenAI-specific integration that provides:

  • Wrapper around OpenAI API client
  • Methods for chat completions, embeddings, moderation, and image generation
  • Schema definition for input validation

Main Features

  1. Workflow Configuration:

    • Define HTTP endpoints with paths and methods
    • Configure security settings (public/authenticated access)
    • Set up input validation
    • Map request data to action inputs
  2. Integration System:

    • Plugin-based architecture for integrating external services
    • Each integration provides named methods that can be called from workflows
  3. Request Processing:

    • Input validation against JSON schema
    • Flexible mapping from request data (body, headers, query params) to action inputs
    • Support for nested object mapping and direct values
  4. CORS Support:

    • Built-in CORS handling for cross-origin requests

Development

Setup

This project uses pnpm for package management. Make sure you have Node.js (v18+) and pnpm installed on your system.

# Install dependencies
pnpm install

# Build all packages
pnpm build

# Start development mode with watch
pnpm dev

Running Tests

The project uses Vitest for testing:

# Run all tests
pnpm test

Example Test Structure

import { afterAll, beforeAll, describe, expect, it } from 'vitest';

describe('Feature name', () => {
  beforeAll(() => {
    // Setup code that runs once before all tests
  });

  afterAll(() => {
    // Cleanup code that runs once after all tests
  });

  it('should behave in a certain way', () => {
    // Test code
    expect(result).toBe(expectedValue);
  });
});

Code Style

Format code with:

pnpm format

Run linter:

pnpm lint

Check types:

pnpm typecheck

Best Practices

  • Use descriptive test descriptions
  • Separate setup and teardown with beforeAll/afterAll
  • Run the combined command for code quality:
pnpm lint && pnpm typecheck

Package Usage

backend-core

import { serve } from '@yamakasinge/backend-core';

const config = {
  // Backend configuration
};

const server = serve(config);

openai

import { serve } from '@yamakasinge/backend-core';
import OpenAI from '@yamakasinge/openai';

const config = {
  workflows: [/* ... */],
  integrations: [OpenAI],
  production: false
};

serve(config);

Building for Production

# Build all packages for production
pnpm build

This will generate optimized ES modules in the dist folder of each package.