🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

react-i18n-mini-parser

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-i18n-mini-parser

NodeJS module for extracting default i18n messages from a project files where using react-i18n-mini.

1.1.0
latest
Source
npm
Version published
Weekly downloads
536
-4.8%
Maintainers
1
Weekly downloads
 
Created
Source

react-i18n-mini-parser

NodeJS module for extracting i18n messages.

Can be used with:

  • react-i18n-mini
  • solid-i18n.

Example of usage

npm i -D react-i18n-mini-parser
import fs from 'fs';
import glob from 'glob';
import { extract } from 'react-i18n-mini-parser';

glob("**/*.+(js|ts|tsx)", function(error, files) {
  const { messages } = extract(files.map(file => fs.readFileSync(file, 'utf8')));
  fs.writeFileSync('./locales/en.json', JSON.stringify(messages, null, '  '), 'utf8');
});

Note: glob is using as an example. You can use any tool or write your own to find all files that need to be parsed.

Keywords

intl

FAQs

Package 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