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

rewyre

v2.5.0

Published

A fast and flexible wiring tool for developing RESTful and WebSocket APIs using TypeScript decorators.

Downloads

52

Readme

The rewyre framework is built on top of express, and express-ws and utilises TypeScript and decorators to give you a powerful wiring tool to create API applications in a very short time with built-in support for MySQL/MongoDB for models.

Important Changes

See the docs/migrating/v1-v2.md for more information regarding the move to V2.

The framework's version 2 release is now licensed under MIT.

Installation

You can install from NPM with:

npm install --save rewyre

Bootstrap Application

As part of some new changes, I have added a simple bootstrap script, it doesn't do very much other than create a basic application with eslint, and all the required packages, you can use it like:

npx rewyre create-rewyre <foldername/appname>

Getting Started

Below is a simple example showing a database connection and a simple find, for a more in-depth example, have a look at the test folder in the source, which has a simple to-do demo.

Note: The expectation is that this framework is to be used with TypeScript specifically and that you would you use your own tooling for building and compiling it, of course, you can use JavaScript and babel instead, but it is suggested to use TypeScript, for help with setting up, look at the tsconfig.json file inside of the test folder.

// Import the parts we need.
import { Framework, Drivers, Controller, Route, IReturn, Model, AbstractModel, AbstractController } from 'rewyre';


// Define our controller.
@Controller('/', 'home')
class HomeController extends AbstractController {

	@Route('GET', '/')
	public async index(): Promise<IReturn> {
		const users = await this.users.find({});
		return { status: 200, content: users };
	}
}


// Define our model.
@Model('users', 'general', {
	username: 'string',
	password: 'string',
	blocked: 'boolean',
	block_reason: '?string',
})
class UsersModel extends AbstractModel {}


// Create an isolated async function.
(async() => {

	// Create an instance of the framework.
	const application: Framework = new Framework({
		port: 3005,
		database: true,
		databases: [
			{
				unique: 'primary',
				host: 'localhost',
				port: '27017',
				name: 'example-app',
				driver: Drivers.MONGO,
				default: true,
			},
		],
	});

	// Register classes.
	application.register([
		HomeController,
		UsersModel,
	]);

	// Start the server.
	await application.start();
})();

Available Features

The below lists the features and their stable state, this framework's API will not change for the forseable future, any changes will be fully implemented and any non-backwards compatible changes will be in the latest major version, following the semver versioning scheme.

| Feature | Description | Status | | - | - | - | | HTTP Server | The HTTP server is the base for the framework and is built on top of Express. | Stable | | WebSocket Server | The WebSocket server uses express-ws package to apply WebSocket support. | Stable | | Middleware Support | Standard Express middleware is supported using the useMiddleware method. | Stable | | Static Assets | Standard Express static is supported as well using the useStatic method. | Stable | | Controllers | Controller classes and the @Controller decorator are both implemented. | Stable | | Controller Routes | Controller routes are and the @Route decorator are both implemented. | Stable | | Models | Model classes and the @Model decorator are both implemented. | Stable | | Drivers | Database drivers allow you to use one of the many implemented into the framework. | Stable | | Custom Drivers | Define your own database drivers to implement other databases into your framework. | Stable | | Framework Hooks | Allows you to hook functions into internal events. | Beta | | Plugin Support | See documentation but plugins are now implemented to allow you to package code pieces into reusable and shareable components. | Beta | | Multiple Databases | Your models can use any database, including multiple, have data in many databases? Write a model around a specific database instead or just fallback to the default. | Beta | | Injections | Injections are done using a single @Inject decorator and you can inject one or many, you can inject models and providers to any service or controller as required. | Stable | | Services | Service classes and the @Service decorator are both implemented and services can run on a loop based on seconds. | Stable | | Providers | Providers and the @Provide decorator are both implemented, the provider allows you to create built in helper classes that can be injected to controllers, and services. | Stable |

Upcoming Features

Upcoming features that are planned, some features may come out quicker due to technical requirements.

  • ~~Plugin Support - There is a plan to add plugin support, but I am not sure what this will look like yet.~~
  • ~~Multiple Databases - Support for using multiple databases using database drivers alongside your own.~~
  • Model Extend - Allow developers to extend models to add more fields for validation.

Future Plans

The future for this library is big, I have many plans to add lots of new features and more decorators to add additional features, and I plan to turn this (slowly) into a full out-of-the-box TypeScript based framework for building Node.JS server side applications. This framework will be able to handle any structure and can be included into other applications like Vue.JS Server-Side Rendering alongside using it render HTML based applications instead of only API based.