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

format-message-print

Package Overview
Dependencies
Maintainers
4
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

format-message-print

Pretty print compact message format ast

  • 6.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

format-message-print

Pretty print compact message format ast

npm Version JS Standard Style MIT License

Turns a compact format-message ast:

[ "You have ", [ "numBananas", "plural", 0, {
     "=0": [ "no bananas" ],
    "one": [ "a banana" ],
  "other": [ [ '#' ], " bananas" ]
} ], " for sale." ]

into a pretty ICU Message Format string:

`You have {
  numBananas, plural,
     =0 {no bananas}
    one {a banana}
  other {# bananas}
} for sale`

Quick Examples

npm install format-message-print --save

import parse from 'format-message-parse'
import print from 'format-message-print'

print(parse('Hello, {name}!'))
//-> 'Hello { name }!'

API

print(pattern)

Generate a string from an ast. The output is a canonical version of the pattern.

License

This software is free to use under the MIT license. See the LICENSE-MIT file for license text and copyright information.

Keywords

FAQs

Package last updated on 17 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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