Registry / devops / webframe-base

webframe-base

JSON →
library0.7.23jsnpmunverified

Webframe Base is a Node.js framework designed for building RESTful APIs and systems. It provides a minimalistic structure for routing, middleware, and request handling. The current stable version is 0.7.23, released with an unspecified cadence. It focuses on simplicity and extensibility, differing from larger frameworks like Express by offering a more lightweight core with fewer built-in features, suitable for microservices and small to medium projects. The framework supports both CommonJS and ESM modules, and includes basic error handling and logging capabilities.

npm install webframe-base
INSTALL
IMPORT
SIG · WEBFRAME-BASE
W
webframe-base
devopsjavascriptv0.7.23
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Server
✓ import { Server } from 'webframe-base'
✗ const Server = require('webframe-base').Server
ESM is preferred; CommonJS require works with .default for default exports but Server is named.
Router
✓ import { Router } from 'webframe-base'
✗ import Router from 'webframe-base'
Router is a named export, not default.
Request
✓ import { Request } from 'webframe-base'
✗ const { Request } = require('webframe-base')
TypeScript users should import type if needed: import type { Request } from 'webframe-base'.
Response
✓ import { Response } from 'webframe-base'
✗ const { Response } = require('webframe-base')
Same as Request import pattern.

This example sets up a basic REST server with a single GET endpoint that returns a JSON response.

import { Server, Router } from 'webframe-base'; const app = new Server(); const router = new Router(); router.get('/hello', (req, res) => { res.send({ message: 'Hello, world!' }); }); app.use(router); app.listen(3000, () => { console.log('Server running on port 3000'); });
Debug
Known issues
deprecatedThe 'bodyParser' middleware has been deprecated in favor of built-in body parsing in v0.7.0.
fix
Use the built-in parseBody option when creating the server: new Server({ parseBody: true })
affects: >=0.7.0
breakingIn v0.6.0, error handling changed: errors must be explicitly caught with .catch on routes, the global error handler is removed.
fix
Add error handling middleware using router.use((err, req, res, next) => { ... })
affects: >=0.6.0
gotchaWhen using TypeScript, the framework types are not shipped; you need to install @types/webframe-base separately.
fix
npm install --save-dev @types/webframe-base
affects: 0.x
deprecatedThe 'createServer' function was deprecated in v0.5.0; use 'new Server()' instead.
fix
Replace createServer() with new Server()
affects: >=0.5.0
gotchaRoute order matters: routes defined after a catch-all route will not be matched.
fix
Place specific routes before wildcard routes.
affects: 0.x
Errors
Common errors & fixes
TypeError: Server is not a constructor
Incorrect import: using default import when Server is a named export.
fix
Use import { Server } from 'webframe-base' instead of import Server from 'webframe-base'
Error: listen EADDRINUSE :::3000
Port already in use by another process.
fix
Use a different port or kill the existing process: lsof -i :3000, then kill -9 <PID>
Cannot find module 'webframe-base' or its corresponding type declarations
Package not installed or missing TypeScript types.
fix
Run npm install webframe-base and optionally npm install --save-dev @types/webframe-base
Upgrade
Version history
0.7.23latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
webframe-base — npm install webframe-base · libregistry