Liqd Framework

raw JSON →
1.7.13 verified Fri May 01 auth: no javascript

Liqd Framework is a Node.js server framework that bundles a collection of liqd-* libraries for building web applications and APIs. Version 1.7.13 is the latest stable release, with infrequent updates. It provides a modular architecture with routing, middleware, and HTTP utilities. Compared to Express or Fastify, it is less widely adopted and has limited community support, but offers a cohesive set of tools from the same ecosystem. The framework emphasizes simplicity and minimal dependencies, making it suitable for small to medium projects.

error Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
cause Using require() to import an ESM-only package.
fix
Switch to import syntax and enable ESM in your project.
error TypeError: router.get() is not a function
cause Router is imported incorrectly (using default import instead of named import).
fix
Use import { Router } from 'liqd-framework'.
gotcha The framework is ESM-only. Using require() will throw a runtime error.
fix Use import syntax and ensure your project is configured for ESM (e.g., type: "module" in package.json).
gotcha Middleware and route handlers must return a Promise or use async/await; synchronous handlers may cause unexpected behavior.
fix Always return a Promise or mark handler as async.
deprecated The .use() method for mounting sub-applications is deprecated in favor of .mount().
fix Replace .use(subApp) with .mount(subApp).
npm install liqd-framework
yarn add liqd-framework
pnpm add liqd-framework

Creates a basic HTTP server with a single route and starts listening on port 3000.

import Liqd from 'liqd-framework';

const app = new Liqd();

app.get('/', (req, res) => {
  res.send('Hello, world!');
});

app.listen(3000, () => {
  console.log('Server running on http://localhost:3000');
});