@phensley/messageformat
Advanced tools
Comparing version 1.0.7 to 1.0.8
{ | ||
"name": "@phensley/messageformat", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Extensible ICU message formatter", | ||
@@ -39,20 +39,20 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@phensley/cldr-utils": "1.0.7", | ||
"@phensley/decimal": "1.0.7", | ||
"@phensley/plurals": "1.0.7", | ||
"tslib": "1.11.1" | ||
"@phensley/cldr-utils": "1.0.8", | ||
"@phensley/decimal": "1.0.8", | ||
"@phensley/plurals": "1.0.8", | ||
"tslib": "^1.11.1" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.7.8", | ||
"@types/jest": "25.1.3", | ||
"@types/node": "^10.14.10", | ||
"@types/jest": "^25.1.3", | ||
"@types/node": "^13.9.2", | ||
"beautify-benchmark": "^0.2.4", | ||
"benchmark": "^2.1.4", | ||
"chalk": "^2.3.2", | ||
"jest": "25.1.0", | ||
"jest": "^25.1.0", | ||
"rimraf": "^3.0.0", | ||
"ts-jest": "25.2.1", | ||
"tslint": "^5.18.0", | ||
"ts-jest": "^25.2.1", | ||
"tslint": "^6.1.0", | ||
"tslint-no-circular-imports": "^0.7.0", | ||
"typescript": "3.8.x" | ||
"typescript": "^3.8.x" | ||
}, | ||
@@ -72,3 +72,3 @@ "jest": { | ||
}, | ||
"gitHead": "f411d4925d2d57589ef2cd9f1c13ef6871224bc3" | ||
"gitHead": "42451ff35e9b5e3abeb04d2fd71ae0fc0639a82a" | ||
} |
@@ -1,9 +0,31 @@ | ||
[`@phensley/messageformat`](https://www.npmjs.com/package/@phensley/messageformat) ![min+gzip](https://badgen.net/bundlephobia/minzip/@phensley/messageformat) | ||
# @phensley/messageformat | ||
Compact and extensible ICU message formatter with built-in support for `plural`, `select`, and `selectordinal`. | ||
[![@phensley/messageformat](https://badge.fury.io/js/%40phensley%2Fmessageformat.svg)](https://www.npmjs.com/package/@phensley/messageformat) [![min+gzip](https://badgen.net/bundlephobia/minzip/@phensley/messageformat)](https://bundlephobia.com/result?p=@phensley/messageformat) | ||
### Examples | ||
Compact and extensible ICU message formatter with built-in support for `plural`, `select`, and `selectordinal`. Also supports plural calculations using arbitrary precision decimal numbers. | ||
## Installation | ||
NPM: | ||
``` | ||
npm install --save @phensley/messageformat | ||
``` | ||
Yarn: | ||
``` | ||
yarn add @phensley/messageformat | ||
``` | ||
## Examples | ||
#### Setup | ||
The package allows you to wire up the different types how you want. Things are broken out so that parsing can be done separately from evaluation. | ||
Parsing can be done at build time -- read a YAML file, parse messages and embed them into a YAML/JSON file, or embed them into code, for faster runtime message evaluation. | ||
Custom formatting and argument conversion functions can be defined and plugged into the framework. | ||
```typescript | ||
@@ -76,5 +98,5 @@ import { pluralRules } from '@phensley/plurals'; | ||
#### Example 2 - MessageFormatter | ||
#### Example 2 - MessageFormatter class | ||
If you don't need to embed parsed messages into source code, the `MessageFormatter` can parse and cache messages at runtime. Internally it uses a least-recently-used cache whose size can be configured. | ||
If you don't need to embed parsed messages into source code, the `MessageFormatter` can parse and cache messages at runtime. Internally it uses a least-recently-used cache whose size can be configured. There is no need for the elaborate setup in the first example. | ||
@@ -81,0 +103,0 @@ ```typescript |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
140381
200
+ Added@phensley/cldr-utils@1.0.8(transitive)
+ Added@phensley/decimal@1.0.8(transitive)
+ Added@phensley/plurals@1.0.8(transitive)
+ Addedtslib@1.14.1(transitive)
- Removed@phensley/cldr-utils@1.0.7(transitive)
- Removed@phensley/decimal@1.0.7(transitive)
- Removed@phensley/plurals@1.0.7(transitive)
- Removedtslib@1.11.1(transitive)
Updated@phensley/cldr-utils@1.0.8
Updated@phensley/decimal@1.0.8
Updated@phensley/plurals@1.0.8
Updatedtslib@^1.11.1