@just-web/formatjs
v1.0.5
Published
formatjs gizmo for just-web applications
Downloads
1
Readme
@just-web/formatjs
@just-web/formatjs provides Format.JS support for @just-web applications.
It re-exports @formatjs/intl so that you can access all functionality of @formatjs/intl directly.
Install
# npm
npm install @just-web/formatjs
# yarn
yarn add @just-web/formatjs
# pnpm
pnpm install @just-web/formatjs
#rush
rush add -p @just-web/formatjs
Usage
The formatJSGizmoFn()
accepts the same parameters as createIntl()
in object from:
import { justApp } from '@just-web/app'
import { formatJSGizmoFn, createIntlCache } from '@just-web/formatjs'
const cache = createIntlCache()
const app = await justApp({ name: 'your-awesome-app' })
.with(formatJSGizmoFn({
config: { locale: 'en', messages: {} },
cache
}))
.create()
app.formatjs.intl.formatMessage({ defaultMessage: 'hello world' })