Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@networkteam/eel

Package Overview
Dependencies
Maintainers
5
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@networkteam/eel

Embedded expression language, a parser and compiler for a safe subset of JavaScript for dynamic evaluation in JavaScript.

  • 1.5.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

@networkteam/eel

Embedded expression language, a parser and compiler for a safe subset of JavaScript for dynamic evaluation in JavaScript.

Features

  • Safe evaluation of JS expressions:
    • !a || (b && c)
    • number == 42
    • foo.bar.baz
  • Compiles expressions from strings to plain JS functions
  • Safe to use with user generated expressions (e.g. as a filter language)
  • Use in the browser or with Node.js

Installation

yarn add @networkteam/eel

or

npm install --save @networkteam/eel

Usage

import { compile } from '@networkteam/eel`

const expr = compile('myVar');

const result = expr({myVar: 'a', 'otherVar': b});

// result === 'a'

Ideally, the expression should be pre-compiled. The generated function can be used with different context values to evaluate the result.

Reference

compile(expression)

expression: string

Compiles the given expression and returns a function that receives the current context for evaluation. The context must be an object that contains all defined variables as properties.

Licence

MIT

FAQs

Package last updated on 09 Jan 2020

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc