You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@formatjs/ts-transformer

Package Overview
Dependencies
Maintainers
3
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formatjs/ts-transformer

TS Compiler transformer for formatjs


Version published
Weekly downloads
599K
decreased by-5.57%
Maintainers
3
Install size
34.2 MB
Created
Weekly downloads
 

Package description

What is @formatjs/ts-transformer?

@formatjs/ts-transformer is a TypeScript transformer for FormatJS, which is a set of libraries to internationalize your project. This transformer helps in extracting and compiling messages for localization, making it easier to manage and use localized strings in your TypeScript projects.

What are @formatjs/ts-transformer's main functionalities?

Message Extraction

This feature allows you to define and extract messages that can be used for localization. The `defineMessages` function is used to create a collection of messages with unique IDs, default messages, and descriptions.

const messages = defineMessages({
  greeting: {
    id: 'greeting',
    defaultMessage: 'Hello, World!',
    description: 'Greeting to welcome the user'
  }
});

Message Compilation

This feature compiles the defined messages into a format that can be used by the application. The `compile` function takes the messages and processes them for use in the application.

import { compile } from '@formatjs/ts-transformer';

const compiledMessages = compile(messages);

TypeScript Integration

This feature integrates with TypeScript's compiler to transform and process the messages during the build process. The `transform` function is used in the TypeScript configuration to apply the transformer.

import { transform } from '@formatjs/ts-transformer';

const tsConfig = {
  compilerOptions: {
    plugins: [{
      transform: '@formatjs/ts-transformer',
      type: 'config'
    }]
  }
};

Other packages similar to @formatjs/ts-transformer

Readme

Source

@formatjs/ts-transformer

We've migrated the docs to https://formatjs.io/docs/tooling/ts-transformer.

Keywords

FAQs

Package last updated on 19 May 2024

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc