# @fluent/bundle

> Localization library for expressive translations.

Latest version **0.19.1** (published 2025-04-02) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @fluent/bundle
pnpm add @fluent/bundle
yarn add @fluent/bundle
bun add @fluent/bundle
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.19.1 |
| Published | 2025-04-02 |
| First published | 2019-07-25 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 0 |
| Unpacked size | 136.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1009 |
| Author | Mozilla |
| Maintainers | eemeli, zbraniecki, tatumcreative, flod |
| Keywords | localization, l10n, internationalization, i18n, ftl, plural, gender, locale, language, formatting, translate, translation, format, parser |

## Links

- npm: https://www.npmjs.com/package/@fluent/bundle
- Repository: https://github.com/projectfluent/fluent.js
- Homepage: https://projectfluent.org
- Issues: https://github.com/projectfluent/fluent.js/issues
- npm.io page: https://npm.io/package/@fluent/bundle

## Alternatives

- [messageformat](https://npm.io/package/messageformat.md) — 329.7K weekly downloads
- [@mintlify/scraping](https://npm.io/package/@mintlify/scraping.md) — 294.8K weekly downloads
- [@mintlify/previewing](https://npm.io/package/@mintlify/previewing.md) — 209.5K weekly downloads
- [@mintlify/prebuild](https://npm.io/package/@mintlify/prebuild.md) — 209.5K weekly downloads
- [@mintlify/link-rot](https://npm.io/package/@mintlify/link-rot.md) — 206.3K weekly downloads

## Recent versions

- 0.19.1 (latest) — 2025-04-02
- 0.19.0 — 2025-03-25
- 0.18.0 — 2023-03-13
- 0.17.1 — 2021-12-21
- 0.17.0 — 2021-09-13
- 0.16.1 — 2021-04-09
- 0.16.0 — 2020-07-01
- 0.15.1 — 2020-04-07
- 0.15.0 — 2020-01-23
- 0.14.1 — 2019-12-20
- 0.14.0 — 2019-07-30
- 0.13.0 — 2019-07-25

## README

# @fluent/bundle ![](https://github.com/projectfluent/fluent.js/workflows/test/badge.svg)

`@fluent/bundle` is a JavaScript implementation of [Project Fluent][],
optimized for runtime performance.

[project fluent]: https://projectfluent.org

## Installation

`@fluent/bundle` can be used both on the client-side and the server-side. You
can install it from the npm registry or use it as a standalone script (as the
`FluentBundle` global).

    npm install @fluent/bundle

## How to use

The `FluentBundle` constructor provides the core functionality of formatting
translations from FTL files.

```javascript
import { FluentBundle, FluentResource } from "@fluent/bundle";

let resource = new FluentResource(`
-brand-name = Foo 3000
welcome = Welcome, {$name}, to {-brand-name}!
`);

let bundle = new FluentBundle("en-US");
let errors = bundle.addResource(resource);
if (errors.length) {
  // Syntax errors are per-message and don't break the whole resource
}

let welcome = bundle.getMessage("welcome");
if (welcome.value) {
  bundle.formatPattern(welcome.value, { name: "Anna" });
  // → "Welcome, Anna, to Foo 3000!"
}
```

The API reference is available at https://projectfluent.org/fluent.js/bundle.

## Compatibility

`@fluent/bundle` requires the following `Intl` formatters:

- `Intl.DateTimeFormat` (standard, well-supported)
- `Intl.NumberFormat` (standard, well-supported)
- `Intl.PluralRules` (standard, well-supported)

See also the [Compatibility][] article on the `fluent.js` wiki.

[compatibility]: https://github.com/projectfluent/fluent.js/wiki/Compatibility

---
_Source: https://npm.io/package/@fluent/bundle · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
