Documentation
¶
Overview ¶
dfl.mod.js is the package for go-dfl that is built as a JavaScript module. In modern JavaScript, the module can be imported using destructuring assignment. The functions are defined in the Exports variable in the dfljs package.
Usage
// Below is a simple set of examples of how to use this package in a JavaScript application.
// load functions into current scope
const { parse } = require('./dist/dfl.global.min.js);
// Parse an expression into a node
var { node, err } = parse("@a + @b")
// Compile the node
node = node.compile()
// Evaluate the node
var { result, err } = node.evaluate({"a": 1, "b": 2})
References
Click to show internal directories.
Click to hide internal directories.