UNPKG

@trifrost/core

Version:

Blazingly fast, runtime-agnostic server framework for modern edge and node environments

111 lines (77 loc) โ€ข 5.61 kB
# TriFrost [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftrifrost-js%2Fcore.svg?type=shield&issueType=license)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftrifrost-js%2Fcore?ref=badge_shield&issueType=license) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftrifrost-js%2Fcore.svg?type=shield&issueType=security)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftrifrost-js%2Fcore?ref=badge_shield&issueType=security) [![CodeCov](https://codecov.io/gh/trifrost-js/core/graph/badge.svg?token=WGGKOQH7MB)](https://codecov.io/gh/trifrost-js/core) [![CI](https://github.com/trifrost-js/core/actions/workflows/ci.yml/badge.svg)](https://github.com/trifrost-js/core/actions/workflows/ci.yml) [![CodeQL](https://github.com/trifrost-js/core/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/trifrost-js/core/actions/workflows/github-code-scanning/codeql) [![npm](https://img.shields.io/npm/v/@trifrost/core.svg)](https://www.npmjs.com/package/@trifrost/core) [![npm](https://img.shields.io/npm/dm/@trifrost/core.svg)](https://www.npmjs.com/package/@trifrost/core) **TriFrost** is a blazing-fast, runtime-agnostic server framework built for the modern JavaScript ecosystem โ€” from low-latency edge environments to traditional backend infrastructure. Whether you're deploying to Node.js, Bun, or Cloudflare Workers, TriFrost provides a unified API and internal architecture that adapts to the runtime โ€” without compromising on performance, developer experience, or clarity. --- ## โœจ Why TriFrost? TriFrost is the result of deep experience across frameworks, runtimes, and production systems. It combines: - ๐Ÿงฉ **Koa-like composability** โ€“ build with middleware thatโ€™s small, explicit, and powerful - โšก **High performance** โ€“ with zero-cost abstractions and extremely efficient internals ([see benchmark](https://www.trifrost.dev/news/blog/hello_world_benchmark_trifrost)) - ๐ŸŒ **Edge-native** โ€“ designed from the ground up to support Workers, Bun, and other emerging runtimes - ๐Ÿ“Š **Observability-first** โ€“ tracing and structured logging are core to the architecture Unlike many frameworks, TriFrost doesn't bind itself to Node-specific APIs or assume a single deployment model. Itโ€™s truly runtime-flexible, **write once, run anywhere**. For a deeper read: - [What is TriFrost](https://www.trifrost.dev/docs/what-is-trifrost) - [Why TriFrost?](https://www.trifrost.dev/news/blog/why_trifrost_exists) --- ## ๐Ÿš€ 1.0.0 โ€” Stable and Ready TriFrost v1.0.0 marks the first **stable release**, with a production-ready core and a fully typed public API surface. - โœ… Finalized runtime contract (Node, Bun, Workerd, Cloudflare) - โœ… Stable context, routing, and middleware layers - โœ… Full test coverage and CI/CD hardening - โœ… Built-in logger with structured telemetry + OpenTelemetry support - โœ… Clean internal design with runtime adaptation and zero runtime bloat - โœ… JSX-native request handlers (opt-in, fully typed) > If you've been waiting to try TriFrost in production โ€” this is the version to start with. > If you want to play games ๐ŸŽฎ check out [Atomic Arcade](https://arcade.trifrost.dev), a mini arcade powered by [TriFrost Atomic](https://www.trifrost.dev/docs/jsx-atomic) --- ## ๐Ÿ“ฆ Quickstart TriFrost has a [starter CLI](https://github.com/trifrost-js/create-trifrost) available via `npm create` / `bun create`: ```bash # npm npm create trifrost@latest # bun bun create trifrost@latest ``` Itโ€™ll scaffold a project in under 60 seconds with routing, logging, and runtime setup built-in. View the [doc page for more info](https://www.trifrost.dev/docs/cli-quickstart). --- ## ๐Ÿ“ฆ From Scratch You can also start from first principles. See the [Hello World example](https://www.trifrost.dev/docs/hello-world-example) to build step-by-step with only the core package. --- ## ๐Ÿง  Core Principles TriFrost is built on these foundations: - ๐Ÿง  **No magic**: You should be able to trace exactly how requests are routed and handled - ๐Ÿงฑ **Lean by default**: No unnecessary dependencies, no bloat - ๐Ÿงพ **Typed end-to-end**: Full TypeScript support with strong generics and inference - ๐Ÿงฌ **Runtime-adaptable**: Internals are modular, composable, and runtime-aware For a full view read [Core Principles](https://www.trifrost.dev/docs/core-principles). --- ## ๐Ÿ› ๏ธ API Docs Full documentation for core modules, types, and runtime behavior is available on [trifrost.dev/docs](https://www.trifrost.dev/docs) --- ## ๐Ÿ”— Resources - ๐Ÿง‘โ€๐Ÿ’ป GitHub: [trifrost-js/core](https://github.com/trifrost-js/core) - ๐Ÿ“ฆ npm: [@trifrost/core](https://www.npmjs.com/package/@trifrost/core) - ๐ŸŒ Website: [trifrost.dev](https://trifrost.dev/) - ๐Ÿค– CLI: [Creation CLI](https://github.com/trifrost-js/create-trifrost) - ๐Ÿ’ฌ Discord: [Join the community](https://discord.gg/e9zTXmtBG8) --- ## ๐Ÿค Contributing TriFrost is open to contributions and collaboration. - ๐Ÿ› ๏ธ See [open issues](https://github.com/trifrost-js/core/issues) - ๐Ÿ’ฌ Join [discussions](https://github.com/trifrost-js/core/discussions) - ๐Ÿงช Run tests with `npm run test` or check coverage via `npm run test:coverage` All code is modern TypeScript. **Performance and type safety are first-class concerns, and PRs are reviewed fast**. --- ## ๐Ÿ‘ค Authors Created and maintained by: - [Peter Vermeulen](https://github.com/peterver) With love from the [Atomic](https://arcade.trifrost.dev) systems team.