Socket
Socket
Sign inDemoInstall

jora

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jora

JavaScript object query engine


Version published
Weekly downloads
161K
decreased by-1.11%
Maintainers
1
Weekly downloads
 
Created

What is jora?

Jora is a powerful query language for JavaScript objects, allowing you to perform complex queries and transformations on JSON-like data structures. It is particularly useful for data manipulation, filtering, and aggregation.

What are jora's main functionalities?

Basic Querying

This feature allows you to extract specific fields from an array of objects. In this example, it extracts the 'name' field from each object in the array.

const jora = require('jora');
const data = [{ name: 'Alice', age: 30 }, { name: 'Bob', age: 25 }];
const result = jora('name')(data);
console.log(result); // ['Alice', 'Bob']

Filtering

This feature allows you to filter objects based on certain conditions. In this example, it filters out objects where the 'age' field is greater than 25.

const jora = require('jora');
const data = [{ name: 'Alice', age: 30 }, { name: 'Bob', age: 25 }];
const result = jora('[age > 25]')(data);
console.log(result); // [{ name: 'Alice', age: 30 }]

Aggregation

This feature allows you to perform aggregation operations on fields. In this example, it calculates the sum of the 'age' field across all objects.

const jora = require('jora');
const data = [{ name: 'Alice', age: 30 }, { name: 'Bob', age: 25 }];
const result = jora('age.sum()')(data);
console.log(result); // 55

Nested Queries

This feature allows you to perform queries on nested structures. In this example, it extracts the 'name' field from each object within the 'users' array.

const jora = require('jora');
const data = { users: [{ name: 'Alice', age: 30 }, { name: 'Bob', age: 25 }] };
const result = jora('users[name]')(data);
console.log(result); // ['Alice', 'Bob']

Other packages similar to jora

Keywords

FAQs

Package last updated on 18 Apr 2022

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