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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nova-ts/core

v1.0.3

Published

A serverside framework used to build scalable application

Readme

@nova-ts/core

🧩 Core runtime package for the NovaTS web framework — built for clean, decorator-driven TypeScript APIs on top of Express.


✨ Features

  • ✅ Decorator-based routing (@GetMapping, @PostMapping, etc.)
  • ✅ Controller and method-level metadata mapping
  • ✅ Parameter decorators (@PathVariable, @RequestParam, @RequestBody, @RequestHeader, @Request)
  • ✅ Dependency injection friendly (via @nova-ts/context)
  • ✅ Express route binding via HttpFactory
  • ✅ Seamless bootstrap with ApplicationFactory
  • ✅ Global and route-level filter support (@Filter)
  • ✅ Response transformation decorator (@Response)
  • ✅ Custom request pipeline via NovaFilterExecutor
  • ✅ Centralized exception handling (@ExceptionHandler, NovaExceptionResolver)
  • ✅ YAML-based application configuration loading
  • ✅ Configuration property injection via @Value (supports class-level and field-level)
  • ✅ Auto-parsing and validation of request bodies using class-transformer + class-validator

📦 Installation

npm install @nova-ts/core

Also install peer dependencies:

npm install @nova-ts/context class-transformer class-validator

🚀 Getting Started

// main.ts
import { autoBind } from "@nova-ts/context";
import { ApplicationFactory } from "@nova-ts/core";

await autoBind("./dist/dev");

const Application = new ApplicationFactory();
Application.setPort(8080);
Application.InitializeApplication();
Application.startApplication();

🧱 Example Usage

// user.controller.ts
import {
  Controller, GetMapping, PostMapping,
  PathVariable, RequestBody, Filter, Response
} from '@nova-ts/core';

import { LoggerFilter } from './filters/logger.filter';
import { MaskEmailResponse } from './responses/mask-email.response';
import { CreateUserDto } from './dto/create-user.dto';

@Controller('/users')
export class UserController {
  @GetMapping('/{id}')
  getUser(@PathVariable('id') id: string) {
    return { id, name: 'John Doe', email: '[email protected]' };
  }

  @PostMapping('/')
  createUser(@RequestBody() user: CreateUserDto) {
    return { success: true, data: user };
  }
}

⚙️ YAML Configuration & @Value

# application.yml
nova:
  class:
    validate: true
  user:
    name: "John"
    password: 1234
  username: "Robert"
import { Value } from '@nova-ts/core';

@Value('nova.user') // Class-level binding
export class PropertyUser {
  name: string;
  password: number;

  @Value('nova.username') // Field-level override
  username: string;
}

The values will be injected into the class and registered in ApplicationContext.


❗ Exception Handling

import { ExceptionHandler } from '@nova-ts/core';

export class GlobalExceptionHandler {
  @ExceptionHandler(MyCustomError)
  handleMyError(err: MyCustomError, req, res) {
    res.status(400).json({ error: err.message });
  }

  @ExceptionHandler(Error)
  handleGenericError(err: Error, req, res) {
    res.status(500).json({ error: 'Unexpected error' });
  }
}

NovaExceptionResolver routes exceptions to their registered handler automatically.


✅ Validated RequestBody

// create-user.dto.ts
import { IsEmail, IsString } from 'class-validator';
import { Expose } from 'class-transformer';

export class CreateUserDto {
  @IsString()
  @Expose()
  name: string;

  @IsEmail()
  @Expose()
  email: string;
}
@PostMapping('/')
create(@RequestBody() body: CreateUserDto) { // enable nova.class.validate=true for validation
  return { data: body };
}

Invalid requests will be automatically rejected, with detailed validation errors printed in the console.


🧩 Core API

Routing & Controllers

  • @Controller(path) — Define a controller class.
  • @GetMapping(path) — Register a GET endpoint.
  • @PostMapping(path) — Register a POST endpoint.

Parameter Decorators

  • @PathVariable(name) — Read a URL path parameter.
  • @RequestParam(name) — Read a query param.
  • @RequestBody(Class) — Parse and validate request body.
  • @RequestHeader(name) — Get header value.
  • @Request() — Get raw Express Request.
  • @Response() — Get raw Express Response.

Filters & Responses

  • @Filter(MyFilter) — Apply a pre/post filter.

Configuration & Error Handling

  • @Value('path.to.key') — Inject config value.
  • @ExceptionHandler(ErrorClass) — Handle exceptions gracefully.

🔧 Advanced

HttpFactory(app)

Automatically registers all routes into the Express app.

NovaFilterExecutor

Middleware executor for filters and guards.

NovaControllerInvoker

Invokes controllers with fully resolved parameter decorators.

PropertyResolver

Parses all classes annotated with @Value and injects config.

ConfigLoader

Loads .yml configuration file and provides runtime access.


📚 Related Packages

  • @nova-ts/context – Dependency injection
  • @nova-ts/cli – CLI for scaffolding (coming soon)

🛠️ Development

npm run build

📄 License

MIT © 2025 Inbanithi107