Socket
Book a DemoInstallSign in
Socket

symbolic-json

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

symbolic-json

Support non-standard symbolic link json parsing.

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

symbolic-json

npm version Dependency Status Build Status Coverage Status

Credits

This library is inspired by yenv composition, the yaml environment manage stuff library.

Installation

npm install --save symbolic-json

Requires node v4.x or above.

Usage

Declaring a 'symbolic link' in a file (eg. pages.json):

{
  "header": __header.html,
  "body": __content/body.html
}

Reading the file:

const symbolicJSON = require('symbolic-json');

// Reference the json file
const jsonContent = symbolicJSON('pages.json');

// File will now have hydrated content from the symbolic links
console.log(jsonContent);

You can link to text, json, or html files recursively with the __ operator.

{
  "body": __content/body.html,
  "tags": __content/tags.json,
  "description": __content/description.txt
}

Links are relative to the file being parsed.

+---content.json
+---content
|   +---body.html
|   +---tags.json
|   +---tags.description.txt

Changelog

Please see CHANGELOG.md

Author

Jon West - @ddproxy

Keywords

env

FAQs

Package last updated on 19 Dec 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