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

selecthor

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

selecthor

Select JSON data with a query language inspired by SQL.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

SelecTHOR ⚡⚒️

Choose your data the way Thor's hammer chose Thor.

Select JSON data with a query language inspired by SQL.

❯ Features

  • Easy-to-use. Selecthor's API is dead simple, easy to use and easy to replace (if you ever want to).
  • Typed. Selecthor is written 100% in TypeScript, so there is no need to install typings from an external source.
  • Tested. Don't be surprised when using Selecthor, it ships with 100% code coverage.
  • Documented. Modern documentation lives in code. That's why Selecthor contains TSDoc comments where needed.
  • Compatible. Node.js, Browsers? Run Selecthor on the platform of your choice!
  • Independent. Don't be afraid of big lock files. Selecthor uses zero dependencies.

❯ Installation

npm install selecthor
yarn add selecthor

❯ Usage

const { selecthor } = require("selecthor");

const data = {
  animals: [
    {
      legs: 2,
      name: "Chimp",
      speed: {
        kph: 45,
        mph: 27.96
      }
    },
    {
      legs: 4,
      name: "Greyhound",
      speed: {
        kph: 72.42,
        mph: 45
      }
    },
    {
      legs: 4,
      name: "Polar Bear",
      speed: {
        kph: 40,
        mph: 24.85
      }
    }
  ]
};

const query = "SELECT name FROM animals WHERE speed.kph < 70";
const selection = selecthor(data, query);

console.log(JSON.stringify(selection)); // [{"name":"Chimp"},{"name":"Polar Bear"}]

Keywords

FAQs

Package last updated on 03 Sep 2019

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