cfarewell 0.2.1

Locale-correct valedictions for formal correspondence
Documentation
cfarewell-0.2.1 has been yanked.

cfarewell

The right closing line for a formal letter.

crates.io npm Rust API

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 { closing } from '@corbet-labs/cfarewell';

closing('de-ch');
// 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 { closing } = require('@corbet-labs/cfarewell');
<script type="module">
  import { closing } from 'https://cdn.jsdelivr.net/npm/@corbet-labs/cfarewell@0.2.1/dist/browser.js';
  console.log(closing('de-ch'));
</script>

Python wheels, source distributions, and CLI instructions are in the installation guide. JSR publication and Typst availability are listed there explicitly.

Rust

use cfarewell::closing;

assert_eq!(closing("de-ch", None), "Freundliche Grüsse");
assert_eq!(closing("en-gb", None), "Yours sincerely,");

Python

from cfarewell import closing

assert closing("de-ch") == 'Freundliche Grüsse'

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.