Nonprofit Pizza Maker

    calcujson
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.2 • Public • Published

    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

    Keywords

    none

    Install

    npm i calcujson

    DownloadsWeekly Downloads

    6

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    97.5 kB

    Total Files

    37

    Last publish

    Collaborators

    • fergcb