1.0.8 • Published 6 years ago

abos v1.0.8

Weekly downloads
8
License
MIT
Repository
github
Last release
6 years ago

ABOS

A better object syntax

Installation

NPM

npm install abos --save

Yarn

yarn add abos

Globally

npm install abos -g
yarn global add abos
Run
abos file.abos [--dry-run]

Require

const abos = require('abos');
abos(/* JSON HERE */); //eg. file.json or "{stringified json}" or json object

Import

import abos from 'abos';
abos(/* JSON HERE */); //eg. file.json or "{stringified json}" or json object

What does it solve?

With this module your json becomes self-conscious so you can use @top (Root of JSON), @parent (Parent of current scope) or @this (Current scope).

Demo

{
    "jsonItem1": "Hello",
    "jsonItem2": {
        "jsonItem3": "${@top.jsonItem1} W",
        "jsonItem4": "${@this.jsonItem3}or",
    },
    "jsonItem3": {
        "jsonItem4": "${@parent.jsonItem2.jsonItem4}ld"
    }
}

Resolves to

{
    "jsonItem1": "Hello",
    "jsonItem2": {
        "jsonItem3": "Hello W",
        "jsonItem4": "Hello Wor",
    },
    "jsonItem3": {
        "jsonItem4": "Hello World"
    }
}
1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago