Registry / devops / restana

restana

JSON →
library6.0.0jsnpmunverified

A super fast and minimalist Node.js web framework for building REST micro-services, version 6.0.0. Inspired by Express, it provides a simple and intuitive API for routing, request/response handling, and middleware management with high performance. It ships TypeScript definitions and requires Node.js >=24.x. Key differentiators: ultra-lightweight (no dependencies), built-in security defaults (secure error handling, stream safety, immutable config), and native support for HTTPS and HTTP/2. Released regularly on npm with active maintenance. Ideal for micro-services and performance-critical APIs.

npm install restana
INSTALL
IMPORT
SIG · RESTANA
R
restana
devopsjavascriptv6.0.0
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.

restana (default)
import restana from 'restana'
const restana = require('restana')
Package is ESM-only since v6. Use default import to get the factory function.
type Request
import type { Request } from 'restana'
import { Request } from 'restana'
Request is a type, not a runtime value. Use type-only import for TypeScript to avoid runtime error.
type Response
import type { Response } from 'restana'
const { Response } = require('restana')
Response is a type, not a constructor. Use type-only import.
type RouteOptions
import type { RouteOptions } from 'restana'
Available for defining typed route options.

Creates a bare-bones HTTP server with restana, defines a GET route, and starts listening on port 3000.

import restana from 'restana'; import http from 'http'; const service = restana(); service.get('/hello', (req, res) => { res.send('Hello, world!'); }); const server = http.createServer(service); server.listen(3000, () => { console.log('Server running on port 3000'); });
Debug
Known issues
breakingrestana v6 drops CommonJS support; requires ESM imports.
fix
Replace require('restana') with import restana from 'restana' and ensure your project is configured for ESM (e.g., type: 'module' in package.json).
affects: >=6.0.0
breakingNode.js version requirement raised to >=24.x in v6.
fix
Upgrade Node.js to 24.x or later.
affects: >=6.0.0
gotchaThe default error handler returns 'Internal Server Error' for all errors; stack traces are not sent to clients.
fix
No action needed for security; to customize error responses, provide a custom errorHandler in the options.
affects: >=4.0.0
gotchagetConfigOptions() returns a frozen object; mutating it will have no effect.
fix
Do not attempt to modify the returned object; configure options at service creation.
affects: >=4.0.0
gotchaWhen using HTTP/2, ensure you pass an HTTP/2 server instance to restana(); plain HTTP/2 without a valid server may cause errors.
fix
Create an HTTP/2 server using http2.createSecureServer() and pass it to restana({ server: ... }).
affects: >=3.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module ... from ... not supported.
Using require() to import restana v6 which is ESM-only.
fix
Use import restana from 'restana' and set type: 'module' in package.json, or use dynamic import().
TypeError: restana is not a function
Incorrect import: using destructured import like { restana } instead of default import.
fix
Use import restana from 'restana' (default import).
Error: Server must be an instance of http.Server or https.Server
Passing an invalid or undefined server object to restana({ server: ... }).
fix
Ensure you pass a valid http.Server, https.Server, or http2.Http2Server instance.
Upgrade
Version history
6.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
restana — npm install restana · libregistry