locales-bundler

1.0.3 • Public • Published

locales-bundler

npm CI

Script to merge deep hierarchy of JSON files into a flat set of objects (files) containing deep objects inside.

More "independent" version of the gulp-locales-bundler.

Check the Real Life Example to get more context for this script.

Quick Start

Install

Locally to use in runtime:

npm install locales-bundler

Or globally to use in CLI:

npm install -g locales-bundler

Use

Runtime

const localesBundler = require('locales-bundler');

// Gets all JSON files from 'locales' directories under the 'src' path,
// omits the 'locales' directory from the resulting objects (default is '').
const locales = localesBundler('src', 'locales/**/*.json', 'locales');

CLI

Can be used as part of the build process, writes merged JSON files to the destination dir.

locales-bundler -s src -p locales/**/*.json -o locales -d dist

Where -s is source, -p is pattern, -o is omit and -d is destination.

Package Sidebar

Install

npm i locales-bundler

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

9.71 kB

Total Files

17

Last publish

Collaborators

  • loginov-rocks