0.3.1 • Published 2 years ago

calcujson v0.3.1

Weekly downloads
7
License
MIT
Repository
github
Last release
2 years ago

CalcuJSON

A standard for transmitting computable expressions in JSON formatted text.

Installation

yarn add calcujson
npm i calcujson

Usage

import CalcuJSON from 'calcujson'
const parse = CalcuJSON()

const data = {
  type: 'add',
  items: [
    { type: 'num', value: 1 },
    { type: 'num', value: 2, desc: 'II' },
    { type: 'num', value: 3, desc: 'three' },
  ]
}

const computation = parse(data)

console.log(computation.evaluate()) // >>> 6
console.log(computation.desc) // >>> 1 + II + three
0.3.0

2 years ago

0.2.3

2 years ago

0.3.1

2 years ago

0.2.2

2 years ago

0.0.2

3 years ago

0.0.1

4 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago