Skip to content

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

License

Notifications You must be signed in to change notification settings

loginov-rocks/locales-bundler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

locales-bundler

npm CI CD

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks