Giter Club home page Giter Club logo

foxify's Introduction

Foxify Tweet Twitter Follow

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

Inspired by Express & Fastify

Npm Version Node Version TypeScript Version Package Quality Npm Total Downloads Npm Monthly Downloads Open Issues Closed Issues Known Vulnerabilities Dependencies Status Pull Requests License Build Status Coverage Status 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 Contents

Getting Started

Prerequisites

  • Node.js 8.12 or higher is required.

Installation

npm i -s 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

TODO

  • Routing
  • Middleware support
  • Error handling
  • View engine
  • Options & Settings
  • Database Model (Odin)
  • Clustering
  • File storage
  • Job schedule
  • Logging

Versioning

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

Authors

See also the list of contributors who participated in this project.

License

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

Support

If my work helps you, please consider

Become A Patron

Buy Me A Coffee

foxify's People

Contributors

ardalanamini avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.