1.2.1 • Published 9 months ago

ghom-eval v1.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

ghom-eval

Install

npm install ghom-eval

Example

Think of securing access because a malicious Eval can be devastating for your PC!

import { evaluate } from "ghom-eval" // or with CommonJS

evaluate("4 + 5")

Returning

{
  "class": "Number",
  "type": "number",
  "duration": 0,
  "failed": false,
  "input": "4 + 5",
  "output": "9",
  "evaluated": ";() => {\n  return 4 + 5\n}\n"
}

Options

evaluate method has 3 parameters.

  • code string Evaluated code
  • context any Context value to inject in code (default: undefined)
  • contextName string The access name of context (default: "context")

Enjoy!

1.2.0

9 months ago

1.2.1

9 months ago

1.1.1

4 years ago

1.1.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago