react-i18n-mini-parser
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

react-i18n-mini-parser

NodeJS module for extracting i18n messages.

Can be used with:

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.

/react-i18n-mini-parser/

    Package Sidebar

    Install

    npm i react-i18n-mini-parser

    Weekly Downloads

    30

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    18.6 kB

    Total Files

    15

    Last publish

    Collaborators

    • sanich