Registry / devops / vaas-framework

vaas-framework

JSON →
library1.9.16jsnpmunverified

Virtual as a Service (VaaS) is a Node.js framework for building serverless applications using TypeScript. It uses a decorator-based approach to define HTTP endpoints, supports worker threads for isolation, and allows dynamic app loading. Current version 1.9.16. The framework is designed for microservices and multi-tenant apps where each 'app' runs in its own worker thread with configurable resource limits. It requires Node.js 16+ and uses Koa under the hood.

npm install vaas-framework
INSTALL
IMPORT
SIG · VAAS-FRAMEWORK
V
vaas-framework
devopsjavascriptv1.9.16
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.

VaasServerType
import { VaasServerType } from 'vaas-framework'
const VaasServerType = require('vaas-framework')
Type-only export; use TypeScript import for type checking.
Decorator
import { Decorator } from 'vaas-framework'
import Decorator from 'vaas-framework'
Named import, not default. Decorator contains VaasServer method.
VaasConfig
import { VaasConfig } from 'vaas-framework'
TypeScript type, imported for config validation.

Creates a simple HTTP endpoint /hello that returns a JSON response, with VaaS configuration.

// src/apps/mini/index.ts import { VaasServerType, Decorator } from 'vaas-framework' export default class Mini { @Decorator.VaasServer({ type: 'http', method: 'get', routerName: '/hello' }) async hello({ req, res }: VaasServerType.HttpParams) { return { hello: 'world' } } } // vaas.config.js (root) module.exports = { appsDir: '/src/apps', port: 3000, getAppNameByRequest: async (request) => { return request.hostname.split('.')[0]; }, getAppConfigByAppName: async (appName) => ({ maxWorkerNum: 2, allowModuleSet: new Set(['fs', 'path']), timeout: 30000 }), showErrorStack: true, isPrepareWorker: true }
Debug
Known issues
gotchaExport default class required; class name used as app name
fix
Ensure each app file exports a default class. The class name is used to identify the app.
affects: >=1.0
gotchaDecorator.VaasServer must be applied to async methods that accept HttpParams
fix
Use async method with destructured { req, res } parameters of type VaasServerType.HttpParams.
affects: >=1.0
gotcharouterName uses path-to-regexp syntax, not Express-style
fix
Use named parameters like '/user/:id' and access via req.params.id.
affects: >=1.0
gotchaWorker isolation: instance variables shared across requests per worker
fix
Do not rely on instance state; use database or external storage for per-request data.
affects: >=1.0
Errors
Common errors & fixes
Error: Cannot find module 'vaas-framework'
Package not installed
fix
npm install vaas-framework
TypeError: Class extends value undefined is not a constructor or null
Missing default export in app file
fix
export default class AppName { ... }
Decorator.VaasServer is not defined
Incorrect import (default instead of named)
fix
import { Decorator } from 'vaas-framework'
Upgrade
Version history
1.9.16latest on npm
Audit
Dependencies
path-to-regexpoptionalUsed for router pattern matching in Decorator.VaasServer
Agent activity
2 hits · last 30 days
node
2
Resources
vaas-framework — npm install vaas-framework · libregistry