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

broccoli-merge-json

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-merge-json

Broccoloi plugin to merge multiple json files into one

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

broccoli-merge-json

Merge multiple json files into one file.

Installation

npm install --save-dev broccoli-merge-json

Usage Example

var mergeJSON = require('broccoli-merge-json');
var jsonTree = mergeJSON(sourceTree, {
  srcDir: '/languages',
  destDir: '/assets/languages'
});

This would create a .json for each sub directory in /languages. Each resulting json file would contain the json files in the languages directory or any sub directory.

The following directory structure

├─┬ languages
  └─┬ en
    ├── index.json
    ├── global.json
    ├── header.json
    ├── components.json
    └─┬ components
      ├── modal-dialog.json
      └── date-selector.json

would result in the following en.json:

{
  // contents of index.json 
  "global": {
    //contents of global.json
  },
  "header": {
    //contents of header.json
  },
  "components": {
    //contents of components.json
    "modalDialog": {
      //contents of modal-dialog.json
    },
    "dateSelector": {
      //contents of date-select.json
    }
  }
}

Options

srcDir (required), destDir (required)

The destDir directory will be created, and all subdirectories of srcDir will result in a .json file in the destDir.

Keywords

broccoli-plugin

FAQs

Package last updated on 06 Mar 2015

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