v1.0.0 is now live

Newgate JS

The type-safe Node.js framework that natively handles JSON, XML, CSV, and Multipart. Stop fighting body-parsers.

$npm install newgatejs

2.4k+

GitHub Stars

10k+

NPM Downloads

50+

Contributors

100+

Active Projects

Multi-format Parsing

Auto-detects and parses JSON, CSV, XML, and more out of the box.

Express-style Routing

Familiar app.get() syntax for zero learning curve.

Middleware Core

Unstoppable middleware pipeline for auth, logging, and validation.

Enhanced Responses

Helper methods like res.xml() or res.csv() for instant formatting.

Security Built-in

XXE protection, payload limits, and input sanitization.

Auto-Docs

Generates raw OpenAPI spec or HTML docs from your routes.

Speak any language.

Don't fight with body parsers. Newgate automatically detects content types from headers and parses the body into ready-to-use objects.

server.js
1app.post('/api/user', (req, res) => {
2 "text-text-tertiary italic">// ⚡️ Automatically detects JSON
3 const { name, role } = req.body;
4
5 if (role === 'admin') {
6 return res.json({
7 status: 'success',
8 message: `Welcome back, ${name}!`,
9 token: 'eyJhbGciOiJIUzI1Ni...'
10 });
11 }
12});
Incoming Request
curl -X POST /api/user 
  -H "Content-Type: application/json" 
  -d '{"name": "Alice", "role": "admin"}'
BASH
Response Body
{
  "status": "success",
  "message": "Welcome back, Alice!",
  "token": "eyJhbGciOiJIUzI1Ni..."
}
200 OK
Quick Start

Up and running in seconds.

Newgate assumes sane defaults so you can skip the boilerplate config and focus on your logic.

1

Install the package

npm install newgatejs
2

Create your server

Create a default server.js file.

3

Run it

node server.js
server.js
import Newgate from 'newgatejs';

// Initialize app
const app = new Newgate();

// Define a route
app.get('/', (req, res) => {
  return res.json({ 
    hello: 'world', 
    time: Date.now() 
  });
});

// Start listening
app.listen(3000, () => {
  console.log('Server running on port 3000');
});