New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

locution

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

locution

A library to evaluate string expressions

latest
npmnpm
Version
1.0.10
Version published
Maintainers
1
Created
Source

Locution

A library to evaluate string expressions

This version is a copy from ExpressionLanguage component of Symfony (PHP) framework. Futures releases will change the library behaviors to make it more customizable

Quick Usage

import { Locution } from 'locution';

const locution = new Locution(
    {
        foo: (bar: number) => bar * 2
    }
);

locution.evaluate(
    '(foo(10) / my_var) && ("a string" matches "foo" || my_var in my_array)',
    {
        my_var: 42,
        my_array: [21, 42, 45]
    }
); // returns true
ToDo
  • Unit Tests
  • Make some checks in nodes
  • Setup a CI for the repo
  • Generate a website for the documentation

FAQs

Package last updated on 05 Sep 2018

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