Socket
Book a DemoInstallSign in
Socket

ghom-eval

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ghom-eval

JS evaluator

1.2.1
latest
Source
npmnpm
Version published
Weekly downloads
5
-44.44%
Maintainers
0
Weekly downloads
 
Created
Source

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!

Keywords

eval

FAQs

Package last updated on 13 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.