New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

localize-ts

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

localize-ts

Internal library for localization

latest
npmnpm
Version
1.0.4
Version published
Maintainers
0
Created
Source

LOCALIZE-TS

npm version npm downloads

LOCALIZE-TS is a tool used to convert JSON translations into TypeScript definitions. This helps in maintaining type safety and consistency across your localization files.

Installation

You can install LOCALIZE-TS globally or as a dev dependency in your project.

Using npm

npm install -g localize-ts
# or as a dev dependency
npm install --save-dev localize-ts

Using yarn

yarn global add localize-ts
# or as a dev dependency
yarn add --dev localize-ts

Using pnpm

pnpm add -g localize-ts
# or as a dev dependency
pnpm add -D localize-ts

Usage Example

Input JSON (input.json)

{
    "title": "LOCALIZE-TS",
    "description": "This is a {{description}} to show how to use {{package}}",
    "greetings": "Welcome {{name}}!"
}

Output TypeScript (output.ts)

// GENERATED BY LOCALIZE-TS

export interface Translations {
 title: string;
 description: { description: string; package: string };
 greetings: { name: string };
}

Command

To generate the TypeScript definitions, run the following command:

localize-ts -f input.json -o output.ts

This will read the input.json file and generate the TypeScript definitions in output.ts.

FAQs

Package last updated on 10 Nov 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