@localedb/core · @localedb/cli
npm 包与 CLI
在你自己的代码中使用 LocaleDB:一个可离线使用的类型化库,以及一个把你选择的数据写入项目的命令行工具。
npm install @localedb/coreexample.ts
import { getCountry } from "@localedb/core";
const tr = getCountry("TR");
tr?.currency.symbol; // "₺"
tr?.numberFormat.decimalSeparator; // ","
tr?.dateTime.dateFormats.short; // "d.MM.y"
// or from the command line
// npx @localedb/cli get country TR