# @kotwys/formatjs-locale-generator

> Locale generator for FormatJS

Latest version **0.1.2** (published 2020-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kotwys/formatjs-locale-generator
pnpm add @kotwys/formatjs-locale-generator
yarn add @kotwys/formatjs-locale-generator
bun add @kotwys/formatjs-locale-generator
```

Provides the command `formatjs-localegen`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2020-08-07 |
| First published | 2020-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 19.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | kotwys |
| Maintainers | kotwys |
| Keywords | formatjs, locale, generator, localegen, i18n |

## Links

- npm: https://www.npmjs.com/package/@kotwys/formatjs-locale-generator
- Repository: https://github.com/kotwys/formatjs-locale-generator
- Homepage: https://github.com/kotwys/formatjs-locale-generator#readme
- npm.io page: https://npm.io/package/@kotwys/formatjs-locale-generator

## Dependencies (6)

- [js-yaml](https://npm.io/package/js-yaml.md) ^3.14.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.1
- [commander](https://npm.io/package/commander.md) ^6.0.0
- [uglify-js](https://npm.io/package/uglify-js.md) ^3.10.1
- [make-plural-compiler](https://npm.io/package/make-plural-compiler.md) ^5.1.0
- [serialize-javascript](https://npm.io/package/serialize-javascript.md) ^4.0.0

## 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.1.2 (latest) — 2020-08-07
- 0.1.1 — 2020-08-07
- 0.1.0 — 2020-08-07

## README

# FormatJS locale generator

This is a tool to generate locales for FormatJS like ones from `locale-data`
folder from the polyfills.

You may need a locale that is absent or inaccurate there but it can be onerous
to write them by hand. So this uses some source files to generate locales as
the original ones are created but in a more appropriate format.

⚠️ **The currently supported `Intl` APIs are**:
- `Intl.ListFormat`
- `Intl.PluralRules`
- `Intl.RelativeTimeFormat`

## Usage

```
Usage: formatjs-localegen [options] <files...>

Create locales for FormatJS

Options:
  -m <module>    Module to create locale for. If specified, there should be
                 only one input file
  -d <dir>       Output directory (default: "locale-data")
  -l <locale>    Locale code
```

The source files are YAML files like [these ones][example-dir] (Esperanto). The
`Intl` module gets inferred by the file name (see the example folder mentioned
before). You can define it yourself by `-m` option and in this case you can
provide only one file.

## Building

The project uses [Yarn].

```bash
git clone https://github.com/kotwys/formatjs-locale-generator
cd formatjs-locale-generator
yarn
```

The executable will be named `dist/index.js`.

[Yarn]: https://classic.yarnpkg.com/en/
[example-dir]: https://github.com/kotwys/formatjs-esperanto/tree/master/data

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