4 releases

0.4.3 Feb 17, 2021
0.4.2 Feb 12, 2021
0.4.0 Jan 15, 2021
0.3.0 Jan 15, 2021

#585 in HTTP server

50 downloads per month

Apache-2.0

1MB
6K SLoC

JavaScript 4K SLoC // 0.1% comments Rust 897 SLoC // 0.0% comments Rusty Object Notation 597 SLoC // 0.0% comments TypeScript 490 SLoC // 0.2% comments

boltzmann

Build Boltzmann CLI Test Boltzmann CLI & framework

Boltzmann is a JavaScript framework for writing web servers. It is implemented in a single file that lives alongside your code. Boltzmann is focused on delivering a great developer experience and makes its tradeoffs with that goal in mind.

Our design goals:

  • Make all return values from route handlers and middlewares be valid responses, mapping to http semantics.
  • Prefer zero-cost abstractions: pay for what you use and nothing more, including in installation and startup time.
  • Use global types, no special response types.
  • Only modify objects we provide; do not rely on modifications to node's request & response objects.
  • Provide pluggable behavior for body-parsing and middleware, with good defaults.
  • Use only minimal, well-vetted dependencies.
  • Bake in observability (optionally), via Honeycomb tracing.
  • Rely on a little bit of documented convention to avoid configuration.
  • Making throwing Boltzmann away if you need to move on possible.

Boltzmann is implemented in vanilla JavaScript and scaffolds a JavaScript project by default, with TypeScript definitions for your development convenience. It can scaffold a TypeScript project if you choose, but does not otherwise require you to opt into transpilation. We'd like you to be able to run Boltzmann apps under deno or in a web worker some day, so we make API choices that move us toward that goal.

For full Boltzmann docs, visit the documentation site.

Getting started

If you prefer to look at working example code, we've provided examples in the ./examples directory of this repo.

To scaffold a new service with Boltzmann, run the boltzmann command-line tool. You can get it from the releases page or run it via npx boltzmann-cli. (We prebuild for Mac OS, Windows, and GNU Linuxes.) The tool is responsible for initializing a new Boltzmann project as well as keeping it up to date. You enable or disable specific Boltzmann features using the tool.

For example, to scaffold with the defaults:

projects| npx boltzmann-cli hello

A complete project is provided for you, with useful package run scripts and linting. To run: ./boltzmann.js. And to view the response: curl http://localhost:5000/hello/world. Want to know more? Check the docs!

Team

Boltzmann is a joint venture of @ceejbot and @chrisdickinson.

LICENCE

Apache-2.0.

Dependencies

~13MB
~227K SLoC