0.0.1 • Published 6 years ago

callup v0.0.1

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

callup

A simple calling parser

Install

Install with npm

$ npm i callup --save

Install with yarn

$ yarn add callup

Example

const expr = 'fn(a+bf, cb(7) + " Snow", w+3+y)';
const callup = require('callup');
console.log(callup.parse(expr));
// =>
// {
//   "name": "fn",
//   "args": [
//     {
//       "op": "+",
//       "left": "a",
//       "right": "bf"
//     },
//     {
//       "op": "+",
//       "left": {
//         "name": "cb",
//         "args": ["7"]
//       },
//       "right": " Snow"
//     },
//     {
//       "op": "+",
//       "left": "w",
//       "right": {
//         "op": "+",
//         "left": "3",
//         "right": "y"
//       }
//     }
//   ]
// }