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

joqx

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

joqx

Extensible Javascript Object Query Language (joqx)

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

JOQx

Extensible Javascript Object Query (joqx) Language

Introduction

This library was built in order to do complex query on Javascript Objects. The following are the features JOQx language:

  • One liner simple Javascript expression to query a Javascript Object. Multi-line and semi-colon is not supported for simplicity.
  • Supports custom data transforms by registering transformers and using then, ->, or |> operators.
  • Supports intent in order to post process and finalize the result data.
  • The code is compiled to ES5 and optimized for speed. This was made possible using libcore-parser-lalr.

Installation

This library is published in NPM with the package name "joqx"

npm install joqx --save

Usage

The library is compatible with ES module, and CommonJS that can be built into RollupJS, Webpack, and Browserify.

The code below demonstrates how arithmetic addition is compiled and executed.

import { compile } from "joqx";

var context = {
        operand1: 1,
        operand2: 2
    },
    sum = compile('sum = operand1 + operand2');

// compiled JOQx always returns a promise
sum(context).
    then((result) => {

        // result should be 3
        console.log("sum is: ", result);

        // "sum" property also contains 3
        console.log("assigned to sum: ", context.sum);
    });


License

This Project is fully Open Source MIT licensed.

Keywords

Javascript Object Query Language

FAQs

Package last updated on 14 Dec 2017

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