foxify - v1.0.0-beta.0

Foxify Tweet Twitter Follow

The fast, easy to use & typescript ready web framework for Node.js

Inspired by Express & Fastify

Build Status Coverage Status Npm Version Node Version TypeScript Version Package Quality Npm Total Downloads Npm Monthly Downloads Open Issues Closed Issues Known Vulnerabilities Pull Requests License Backers on Open Collective Sponsors on Open Collective Github Stars Github Forks

An efficient server implies a lower cost of the infrastructure, a better responsiveness under load and happy users. How can you efficiently handle the resources of your server, knowing that you are serving the highest number of requests as possible, without sacrificing security validations and handy development?

Enter Foxify. Foxify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture. It is inspired by Fastify and Express and as far as we know, it is one of the fastest web frameworks in town.

Table of Content

Getting Started

Prerequisites

  • Node.js 8.12 or higher is required.

Installation

In case of using GitHub package registry, the package name will be @foxifyjs/foxify.

NPM

npm i foxify

PNPM

pnpm add foxify

Yarn

yarn add foxify

Usage

const Foxify = require('foxify');

let app = new Foxify();

app.get('/', (req, res) => {
res.json({hello: 'world'});
});

// create an error
app.get('/error', (req, res) => {
throw new Error('I Failed :(');
});

// create an http error
app.get('/404', (req, res) => {
throw new HttpException('Not Found', 404);
});

app.start();

More detailed sample is available.

You can also find all the documents here.

Features

  • Written in ES6
  • Robust routing (about 60% faster than Express, almost as fast as Fastify)
  • Express middleware support
  • Robust database modeling (Odin)
  • Simple and powerful error handling
  • Focus on high performance
  • HTTP helpers (redirection, etc)
  • View system supporting lots of template engines
  • Content negotiation
  • Executable for generating applications quickly
  • Error handling

Benchmarks

Machine: Ubuntu 18.04 64-bit, Intel Core i7 (8 cores), 8GiB (DDR4)

Method: autocannon -c 100 -d 40 -p 10 localhost:3000 * 2, taking the second average

sort: Request / Second

Framework Version R/S
Foxify 0.10.7 27,716.8
fastify 1.13.0 26,654.4
bare 10.13.0 22,366.4
hapi 17.7.0 19,662.41
express 4.16.4 17,468
restify 7.2.2 14,660

More detailed benchmarks available here

Credits

Authors

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Contributors

Backers

Thank you to all our backers! 🙏 [Become a backer]

Backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here. [Become a sponsor]

Sponsors

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE file for details

Generated using TypeDoc