Start using FormatJS via one of our integrations:
FormatJS has integrations with common template and component libraries, since that's the place where developers need to format numbers, dates, and string messages for their web app UIs.
Using FormatJS Anywhere
Building an Integration
We're interested in integrations with other popular template/component libraries. At Yahoo, teams use Handlebars, React, and Dust, which is why FormatJS has integrations for these libraries. If you've built or are interested in building a FormatJS integration with another library, feel free to reach out to us!
The existing FormatJS integrations are great models for building a new integration. All of them leverage the same dependencies and build process to create a library that runs on the server and client.
Principles Behind Integrations
The integration library should run everywhere the template/component library runs (e.g. Node.js and the browser).
Author library as ES6 Modules, compiled to CommonJS for Node.js, and a single, bundled file with all of its dependencies for the browser. We use the ES6 Module Transpiler.
Build on and use the built-in
Aggressively cache and reuse format instances using the Intl Format Cache package.
Propagate Intl data through template/component hierarchy to avoid placing burden on user.
Publish integration library on npm.