Socket
Book a DemoInstallSign in
Socket

@speedy/json-extends

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@speedy/json-extends

Extend a JSON file with one or many existing files.

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

@speedy/json-extends

CircleCI npm version Dependency Status devDependency Status

Extend a JSON file with one or many existing files.

Installation

npm install @speedy/json-extends --save

Usage

json.read(filePath, [namedExtends]) ⇒ Promise<T>

Retrieve a JSON file. Supports extends with one or many existing JSON files.

Extends supports also Named Extends paths, as shown in the example.

ParamTypeRequiredDescription
filePathstringtruepath to a JSON file.
namedExtends{[id: string]: string }falseA key value pair of named extends paths

TypeScript

import { json } from "@speedy/json-extends";

const named = {
  "@speedy/commit-msg-hook:latest": "./node_modules/config/config.json"
};

json.read("local-config.json", named)
  .then(content => {
    // json content
  });

JSON file

{
  "extends": [
    "@speedy/commit-msg-hook:latest",
    "./local/config.json"
  ],
  "rules": {
    "no-dash": true
  }
}

json.readSync(filePath, [namedExtends]) ⇒ T

Synchronous version of json.read().

TypeScript

import { json } from "@speedy/json-extends";

const named = {
  "@speedy/commit-msg-hook:latest": "./node_modules/config/config.json"
};

const content = json.readSync("local-config.json", named);

Keywords

json

FAQs

Package last updated on 28 Nov 2017

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