# ICU4X for JavaScript and TypeScript

[ICU4X](https://icu4x.unicode.org) provides components enabling wide range of software internationalization.
It draws deeply from the experience of [ICU4C/J](https://github.com/unicode-org/icu), [ECMA-402](https://github.com/tc39/ecma402/) and relies on data from the [CLDR](https://cldr.unicode.org/) project.

ICU4X's functionality is completely available from JavaScript and TypeScript via WebAssembly, with bindings generated by [Diplomat].

The NPM package's docs can be found [here](https://icu4x.unicode.org/2_0/tsdoc/).

_We are still working on improving the user experience of using ICU4X from other languages. As such, this tutorial may be a bit sparse, but we are happy to answer questions on our [discussions forum] and help you out_

## Using ICU4X

ICU4X can be used like any other NPM package:

```shell
npm add icu
```

`index.mjs`:

```js
import { DateFormatter, DateTimeLength, IsoDate, Locale } from 'icu';

let locale = Locale.fromString('de-CH');

let date = new IsoDate(2025, 1, 2);

let formatter = DateFormatter.createYmde(locale, DateTimeLength.Medium);

console.log(formatter.formatIso(date));
```

```shell
node index.mjs
# Do., 02.01.2025
```

 [discussions forum]: https://github.com/unicode-org/icu4x/discussions
 [Diplomat]: https://github.com/rust-diplomat/diplomat

## Licensing and Copyright

Copyright © 2020-2024 Unicode, Inc. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the United States and other countries.

The project is released under [LICENSE](./LICENSE), the free and open-source [Unicode License](https://www.unicode.org/license.txt), which is based on the well-known MIT license, with the primary difference being that the Unicode License expressly covers data and data files, as well as code. For further information please see [The Unicode Consortium Intellectual Property, Licensing, and Technical Contribution Policies](https://www.unicode.org/policies/licensing_policy.html).
