Introduction

Newgate is a modern, lightweight, multi-format backend framework for Node.js designed to handle JSON, CSV, XML, YAML, and Binary data effortlessly.

What is Newgate?

Unlike traditional frameworks that treat JSON as a first-class citizen and everything else as an afterthought, Newgate is built from the ground up to be format-agnostic. It automatically detects the Content-Type of incoming requests and parses the body into a JavaScript object, regardless of the format.

Did you know?
Newgate also handles response serialization automatically. Just use res.xml(data) or res.csv(data) and we handle the headers and formatting for you.

Key Features

  • Multi-format Parsing: JSON, CSV, XML, YAML, Form-Data, Binary.
  • Express-style Routing: Familiar syntax for easy adoption.
  • Enhanced Responses: Helper methods for all supported formats.
  • Auto-Documentation: Generates OpenAPI specs from your routes.

Architecture Overview

Newgate sits on top of the native Node.js HTTP server but provides a robust pipeline for request processing.

[Client] --> HTTP Request --> [Newgate Core]
                                   |
                             [Format Detector]
                                   |
                          (header: text/csv?) --> [CSV Parser]
                                   |
                           [Middleware Stack]
                                   |
                           [Route  Handler]
                                   |
                          [Response Factory]
                                   |
[Client] <-- HTTP Response <-- (res.csv())
Security Notice
By default, the XML parser has entity: false to protect against XXE attacks. You can override this in the configuration if absolutely necessary.
Last updated: 12/11/2025 Edit on GitHub