franc-cli is a command-line interface (CLI) tool for detecting the natural language of textual input. It acts as a convenient shell wrapper around the core `franc` library, which supports identifying over 180 languages, including various scripts and dialects. The current stable version for `franc-cli` is 8.0.0, which corresponds to breaking changes introduced in `franc` library versions 6.x.x. The project generally follows the `franc` library's release cadence, with updates often driven by new Unicode versions or improvements in language detection models. Its key differentiator is providing quick, direct command-line access to language detection without requiring programmatic integration, making it suitable for shell scripting, data processing pipelines, and rapid prototyping. It is an ESM-only package, requiring Node.js version 12 or higher for execution.
Verified import paths — ran on the pinned version, not inferred.
The `franc-cli` package is a command-line tool. For programmatic language detection within JavaScript/TypeScript applications, you should install and import from the `franc` library package. This library is ESM-only since v6.
This function, from the `franc` library, was renamed from `franc.all` to `francAll` in `franc` v6. It is also ESM-only, requiring a native ES module import.
The `franc` library, which `franc-cli` uses under the hood, became ESM-only in version 6.0.0. Attempting to `require()` it will result in a runtime error (`ERR_REQUIRE_ESM`).
This quickstart demonstrates how to programmatically execute the `franc-cli` command-line tool from a Node.js script using `child_process` and capture its output to detect the language of a given text string.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.