Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@phensley/messageformat

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@phensley/messageformat - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

24

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc