Socket
Socket
Sign inDemoInstall

jiq

Package Overview
Dependencies
3
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jiq

Use existing javascript knowledge to query or mutate data


Version published
Maintainers
1
Created

Readme

Source

Javascript Inline Query (jiq)

JSON querying with javascript and lodash

Installation

npm -g install jiq

or

yarn global add jiq

Concept: use existing javascript knowledge to query or mutate data

Let's start

jiq '.dependencies' package.json
jiq '.scripts|keys|.filter(v => /^test/.test(v))' package.json
ls | jiq '.map(v => v.uppercase)' --save list.txt
curl https://api.github.com/users | jiq --json '.map(x => x.login)'

Query with lodash

Use _ as global variable

curl https://api.github.com/users | jiq --json '.map(x => x.login).map(_.upperFirsst)'

Supported data types

  • YAML
  • JSON
  • TEXT

Pipes

keys
values

Globals

$ (passed data)
_ (lodash)

String functions

uppercase
lowercase
camelcase
upperfirst
capitalize
kebabcase
snakecase
limit
words

Array functions

first
last
head
tail
nth

Keywords

FAQs

Last updated on 08 Nov 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc