cfarewell
The right closing line for a formal letter.
Choose a valediction from 40 locale entries, including Swiss German, British English, French, and Japanese. Explicit wording always takes precedence over table defaults. No model or network calls.
import from '@corbet-labs/cfarewell';
;
// Freundliche Grüsse
Install
| Environment | Command |
|---|---|
| Rust / Cargo | cargo add cfarewell |
| Node.js / npm | npm install @corbet-labs/cfarewell |
| pnpm | pnpm add @corbet-labs/cfarewell |
| Yarn | yarn add @corbet-labs/cfarewell |
| Bun | bun add @corbet-labs/cfarewell |
| Deno | deno add npm:@corbet-labs/cfarewell |
The 0.2.1 JavaScript distribution includes compiled ESM, CommonJS, TypeScript declarations, and a standalone browser module. Node.js 20+ is supported; no TypeScript loader is required.
// CommonJS
const = require;
Python wheels, source distributions, and CLI instructions are in the installation guide. JSR publication and Typst availability are listed there explicitly.
Rust
use closing;
assert_eq!;
assert_eq!;
Python
assert ==
API
| Function | Purpose |
|---|---|
closing(locale, override?) |
Resolve a valediction; even an empty override wins |
availableLocales() / available_locales() |
List the 39 canonical locale codes |
Locale matching is case-insensitive. Resolution tries the exact locale, then its base language, then English: fr-be → fr, xx → en. An override is returned unchanged, including an empty string. The locale table owns punctuation, so callers should not append another comma.
Correspondence family
| Library | Responsibility |
|---|---|
| cletter | Compose the correspondence helpers |
| cgreet | German salutations and titles |
| cfarewell | Locale-specific closings |
| cdate | Calendar-date formatting |
| cink | Handwritten signature images |
Development
Behavior is defined by the locale tables and shared conformance vectors. Rust, JavaScript, and Python run the same vectors. Selected CI checks exercise installed JavaScript tarballs, Python wheels and command-line entrypoints, and Typst packages. Release validation records the actual runtime and platform; Linux results do not establish native Windows or macOS coverage. All five Rust crates forbid unsafe code in their own source.
See the release guide for generation, verification, and publication commands.
License
Apache-2.0, effective immediately from version 0.2.1 across all language distributions. Copyright 2026 Julian Y. Richard Corbet. Previously published versions retain their original license grants.