nanoexpress
Nano-framework for Node.js powered by uWebSockets.js
Last updated 3 days ago by dalisoft .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nanoexpress 
SYNC missed versions from official npm registry.

nanoexpress

Greenkeeper badge Travis Code Climate Scrutinizer Code Quality Coverage Status NPM Downloads NPM Version size gzipsize

Nano-framework for Node.js powered by uWebSockets.js

Documentation available here

Are you want faster and stable performance with extra features, see PRO version

If you want Suport me, please see Support section

See Credits if you want which libraries i've used

Warning

This library does not support HTTP2!

NOTE

This library reached the Stable status and works good, see /examples folder.

This library up to 25% slower than uWebSockets.js on normal and complex application because of method polyfilling layer. Basic usage/examples performance are same as uWebSockets.js, but not in all case gives you same performance.

Requires: Node.js v10 or greater

Benchmarks

Benchmarks Memory Usage

Benchmarked on my macBook Pro 2012 13" (Core i5, 8Gb RAM) performance.

You can see live benchmark results at here

Note: Real-world app memory/rps may differs from these numbers and these numbers are in my macBook

You can install wrk via Homebrew in macOS or Linux

Benchmark command: wrk -t1 -d60 -c100

Motiviation

I've long-time planned somehow create own Express-like alternative Node.js framework, then seen uWebSockets.js. Almost 2 month i've think how do this right and decided to create Node.js framework with almost same as Express API.

This library makes very thin layer between uWebSockets.js and your code. But, gives you very Familiar and Clean API. Async/Await supported out-of-the-box!

Features

  • Async/Await out-of-the-box
  • No async mode supported
  • Easy to use (for Express users especially)
  • Blazing fast performance
  • Ultra lightweight size
  • Resource (CPU / Memory) effecient
  • Familiar API
  • Normalised API
  • Can define routes Declaratively
  • Express-compatible middleware
  • In-built middlewares
  • In-built Stream (Video stream, yay!) support
  • In-built WebSocket support (Express-like API and Events)
  • In-built Schema validator via Ajv
  • Out-of-the-box fast-json-stringify support via {schema} middleware
  • Small working examples
  • TypeScript declaration
  • Tests and CI checked code

Examples

All examples are lives here

Built-in Middlewares

Built-in middlewares implemented at layer-level for performance reason and enables automacilly when needed, not always

  • cookie
  • body-parser
  • express-ws (for comparing, uWS has built-in support at core-level)
  • fast-json-stringify (for serialization)
  • express-ajv (for comparing, for validation, this library does it at layer-level)
  • redoc
  • swagger-ui

In-box Middlewares

I'm excluded in-box modules from initialization for performance reason

How-to import

import { middlewares } from 'nanoexpress/packed';
// or import { passportInitialize } from 'nanoexpress/packed/middlewares';

const app = nanoexpress();
app.use(middlewares.passportInitialize()); // or app.use(passportInitialize());
  • passport

Working Middlewares

  • body-parser (yes, if you don't want built-in)
  • express-fileupload
  • cors (yes, express cors middleware)
  • express-jwt
  • express-session
  • express-graphql
  • passport

Docker Support

If you using alpine or slim version of node images, some errors may happen and you can fix with this minimal guide

Requires

  • git

For git missing error

# FROM ...
RUN apk update && apk add --no-cache git
# your scripts

For Alpine incompatible error

# your scripts
RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2
CMD ["node", "server.js"]

Credits

And to other libraries which used to create this library and without these libraries wouldn't be possible to create this library

License

license

Support

Beerpay GitHub issues

  • Star project
  • Fork project
  • Add Tests to Project
  • Watch project
  • Report bugs
  • Fix issue
  • Make PR

Current Tags

  • 1.1.9                                ...           latest (3 days ago)

139 Versions

  • 1.1.9                                ...           3 days ago
  • 1.1.8                                ...           3 days ago
  • 1.1.7                                ...           3 days ago
  • 1.1.6                                ...           3 days ago
  • 1.1.5                                ...           6 days ago
  • 1.1.4                                ...           9 days ago
  • 1.2.8-pro                                ...           13 days ago
  • 1.2.7-pro                                ...           13 days ago
  • 1.1.3                                ...           13 days ago
  • 1.1.2                                ...           13 days ago
  • 1.2.6-pro                                ...           a month ago
  • 1.1.1                                ...           2 months ago
  • 1.2.5-pro                                ...           3 months ago
  • 1.2.4-pro                                ...           3 months ago
  • 1.2.3-pro                                ...           3 months ago
  • 1.2.2-pro                                ...           3 months ago
  • 1.1.0                                ...           3 months ago
  • 1.0.0                                ...           3 months ago
  • 1.2.1-pro                                ...           3 months ago
  • 1.2.0-pro                                ...           3 months ago
  • 1.1.17-pro                                ...           3 months ago
  • 1.1.16-pro                                ...           3 months ago
  • 1.1.15-pro                                ...           3 months ago
  • 1.1.14-pro                                ...           3 months ago
  • 1.1.13-pro                                ...           3 months ago
  • 1.1.12-pro                                ...           3 months ago
  • 1.1.11-pro                                ...           3 months ago
  • 1.1.10-pro                                ...           3 months ago
  • 1.1.9-pro                                ...           3 months ago
  • 1.1.8-pro                                ...           3 months ago
  • 1.1.7-pro                                ...           3 months ago
  • 1.1.6-pro                                ...           3 months ago
  • 1.1.5-pro                                ...           3 months ago
  • 1.1.4-pro                                ...           3 months ago
  • 1.1.3-pro                                ...           3 months ago
  • 1.1.2-pro                                ...           3 months ago
  • 1.1.1-pro                                ...           3 months ago
  • 1.1.0-pro                                ...           3 months ago
  • 1.0.0-beta                                ...           3 months ago
  • 1.0.0-pro                                ...           3 months ago
  • 0.12.20                                ...           3 months ago
  • 0.12.19                                ...           3 months ago
  • 0.12.18                                ...           3 months ago
  • 0.12.17                                ...           3 months ago
  • 0.12.16                                ...           3 months ago
  • 0.12.15                                ...           3 months ago
  • 0.12.14                                ...           3 months ago
  • 0.12.13                                ...           3 months ago
  • 0.12.12                                ...           4 months ago
  • 0.12.11                                ...           4 months ago
  • 0.12.10                                ...           4 months ago
  • 0.12.9                                ...           4 months ago
  • 0.12.8                                ...           4 months ago
  • 0.12.7                                ...           4 months ago
  • 0.12.6                                ...           4 months ago
  • 0.12.5                                ...           4 months ago
  • 0.12.4                                ...           4 months ago
  • 0.12.3                                ...           4 months ago
  • 0.12.2                                ...           4 months ago
  • 0.12.1                                ...           4 months ago
  • 0.12.0                                ...           4 months ago
  • 0.11.8                                ...           4 months ago
  • 0.11.7                                ...           4 months ago
  • 0.11.6                                ...           4 months ago
  • 0.11.5                                ...           4 months ago
  • 0.11.4                                ...           4 months ago
  • 0.11.3                                ...           4 months ago
  • 0.11.2                                ...           4 months ago
  • 0.11.1                                ...           4 months ago
  • 0.11.0                                ...           4 months ago
  • 0.10.1                                ...           4 months ago
  • 0.10.0                                ...           4 months ago
  • 0.9.7                                ...           4 months ago
  • 0.9.6                                ...           4 months ago
  • 0.9.5                                ...           4 months ago
  • 0.9.4                                ...           4 months ago
  • 0.9.3                                ...           5 months ago
  • 0.9.2                                ...           5 months ago
  • 0.9.1                                ...           5 months ago
  • 0.9.0                                ...           5 months ago
  • 0.8.9                                ...           5 months ago
  • 0.8.8                                ...           5 months ago
  • 0.8.7                                ...           5 months ago
  • 0.8.6                                ...           5 months ago
  • 0.8.5                                ...           5 months ago
  • 0.8.4                                ...           5 months ago
  • 0.8.3                                ...           5 months ago
  • 0.8.2                                ...           5 months ago
  • 0.8.1                                ...           5 months ago
  • 0.8.0                                ...           5 months ago
  • 0.7.7                                ...           5 months ago
  • 0.7.6                                ...           5 months ago
  • 0.7.5                                ...           5 months ago
  • 0.7.4                                ...           5 months ago
  • 0.7.3                                ...           5 months ago
  • 0.7.2                                ...           5 months ago
  • 0.7.1                                ...           5 months ago
  • 0.7.0                                ...           5 months ago
  • 0.6.17                                ...           5 months ago
  • 0.6.16                                ...           5 months ago
  • 0.6.15                                ...           5 months ago
  • 0.6.14                                ...           5 months ago
  • 0.6.13                                ...           5 months ago
  • 0.6.12                                ...           5 months ago
  • 0.6.11                                ...           6 months ago
  • 0.6.10                                ...           6 months ago
  • 0.6.9                                ...           6 months ago
  • 0.6.8                                ...           6 months ago
  • 0.6.7                                ...           6 months ago
  • 0.6.6                                ...           6 months ago
  • 0.6.5                                ...           6 months ago
  • 0.6.4                                ...           6 months ago
  • 0.6.3                                ...           6 months ago
  • 0.6.2                                ...           6 months ago
  • 0.6.1                                ...           6 months ago
  • 0.6.0                                ...           6 months ago
  • 0.5.8                                ...           6 months ago
  • 0.5.7                                ...           6 months ago
  • 0.5.6                                ...           6 months ago
  • 0.5.5                                ...           6 months ago
  • 0.5.4                                ...           6 months ago
  • 0.5.3                                ...           6 months ago
  • 0.5.2                                ...           6 months ago
  • 0.5.1                                ...           6 months ago
  • 0.5.0                                ...           6 months ago
  • 0.4.1                                ...           6 months ago
  • 0.4.0                                ...           6 months ago
  • 0.3.1                                ...           6 months ago
  • 0.3.0                                ...           6 months ago
  • 0.2.3                                ...           6 months ago
  • 0.2.2                                ...           6 months ago
  • 0.2.1                                ...           6 months ago
  • 0.2.0                                ...           6 months ago
  • 0.1.4                                ...           6 months ago
  • 0.1.3                                ...           6 months ago
  • 0.1.2                                ...           6 months ago
  • 0.1.1                                ...           6 months ago
  • 0.1.0                                ...           6 months ago
  • 0.0.1                                ...           6 months ago
Maintainers (1)
Downloads
Today 0
This Week 53
This Month 142
Last Day 0
Last Week 35
Last Month 160
Dependencies (3)
Dev Dependencies (12)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |