Socket
Socket
Sign inDemoInstall

@formatjs/cli

Package Overview
Dependencies
0
Maintainers
3
Versions
247
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formatjs/cli


Version published
Weekly downloads
304K
increased by0.72%
Maintainers
3
Created
Weekly downloads
 

Package description

What is @formatjs/cli?

@formatjs/cli is a command-line tool for internationalizing JavaScript applications. It provides functionalities for extracting, compiling, and managing translation messages, making it easier to handle localization in your projects.

What are @formatjs/cli's main functionalities?

Extract Messages

This command extracts all the translation messages from the JavaScript files in the 'src' directory and outputs them to a JSON file named 'en.json'.

npx formatjs extract 'src/**/*.js' --out-file lang/en.json

Compile Messages

This command compiles the extracted messages from 'en.json' into a format that can be used by the application, outputting the result to 'en-compiled.json'.

npx formatjs compile lang/en.json --out-file lang/en-compiled.json

Compile Messages with Pseudo-Localization

This command compiles the messages with pseudo-localization, which is useful for testing how the application handles different languages and character sets. The output is saved to 'en-pseudo.json'.

npx formatjs compile lang/en.json --pseudo-locale --out-file lang/en-pseudo.json

Format Messages

This command formats the extracted messages in 'en.json' to ensure consistency and readability, saving the formatted messages to 'en-formatted.json'.

npx formatjs format lang/en.json --out-file lang/en-formatted.json

Other packages similar to @formatjs/cli

Readme

Source

@formatjs/cli

We've migrated the docs to https://formatjs.io/docs/tooling/cli.

Keywords

FAQs

Last updated on 21 Aug 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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc