Nitro

Build and deploy universal JavaScript servers

README

[![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![npm-edge version][npm-edge-version-src]][npm-edge-version-href] [![npm-edge downloads][npm-edge-downloads-src]][npm-edge-downloads-href]


⚗️ Nitro

Build and Deploy Universal JavaScript Servers


Why using Nitro?


Nitro provides a powerful toolchain and a runtime framework from the UnJS ecosystem to build and deployany JavaScript server, anywhere!

❯ 🐇 **Rapid development** experience with hot module replacement
❯ 😌 **Multi-provider** deployments with a single codebase and zero-configuration
❯ 💼 **Portable and compact** deployments without `node_modules` dependency
❯ 📁 **Directory structure** aware to register API routes and more with zero configuration
❯ 🤏 **Minimal Design** to fit into any solution with minimum overhead
❯ 🚀 **Code-splitting** and async chunk loading for fast server startup time
❯ 👕 **TypeScript** fully supported
❯ 💾 **Multi-driver storage** and caching layer
❯ 💰 **Route caching** and static **pre-rendering** with built-in crawler
❯ 🐱 **Hackable** to extend almost any part of nitro using options
❯ ✨ **Auto imports** for lazy folks and a tidy minimal codebase
❯ 🏛️ **Best-effort compatibility** for using legacy npm packages and mocking Node.js modules

Who is using Nitro?


Nuxt 3 is using Nitro as its server engine.


📖 Documentation

✍️ Changelog

🏀 Online playground


😺 Quick Start


0️⃣ Create an empty directory nitro-app

  1. ``` sh
  2. mkdir nitro-app
  3. cd nitro-app
  4. ```

1️⃣ Create routes/index.ts:

  1. ```ts [routes/index.ts]
  2. export default defineEventHandler(() => 'nitro is amazing!')
  3. ```

2️⃣ Start development server:

  1. ``` sh
  2. npx nitropack dev
  3. ```

🪄 Your API is ready at http://localhost:3000/

Check .nitro/dev/index.mjs if want to know what is happening

3️⃣ You can now build your production-ready server:

  1. ``` sh
  2. npx nitropack build
  3. ````

4️⃣ Output is in the .output directory and ready to be deployed on almost any VPS with no dependencies. You can locally try it too:

  1. ``` sh
  2. node .output/server/index.mjs
  3. ```

That's it you got it! Read the documentation to learn more.




🌱 nitro is young and under development


Check 🐛 open issues  for the known issues and roadmap and tell us 💡your ideas!



License


Made with 💛 Published under MIT.


[npm-version-src]: https://flat.badgen.net/npm/v/nitropack?style=flat-square&label=stable
[npm-version-href]: https://npmjs.com/package/nitropack

[npm-downloads-src]: https://flat.badgen.net/npm/dm/nitropack?style=flat-square&label=stable
[npm-downloads-href]: https://npmjs.com/package/nitropack

[npm-edge-version-src]: https://flat.badgen.net/npm/v/nitropack-edge?style=flat-square&label=edge
[npm-edge-version-href]: https://npmjs.com/package/nitropack-edge

[npm-edge-downloads-src]: https://flat.badgen.net/npm/dm/nitropack-edge?style=flat-square&label=edge
[npm-edge-downloads-href]: https://npmjs.com/package/nitropack-edge

[github-actions-src]: https://flat.badgen.net/github/status/unjs/nitro?style=flat-square
[github-actions-href]: https://github.com/unjs/nitro/actions?query=workflow%3Aci

[codecov-src]: https://flat.badgen.net/codecov/c/gh/unjs/nitro/main?style=flat-square
[codecov-href]: https://codecov.io/gh/unjs/nitro