![New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions](https://cdn.sanity.io/images/cgdhsj6q/production/86e6ebdea652d20da070ebbda20134b839972db7-1024x1024.webp?w=800&fit=max&auto=format)
Security News
New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
jiq
Advanced tools
Readme
npm -g install jiq
or
yarn global add jiq
Concept: use existing javascript knowledge to query or mutate data
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)'
We have a file
package.json
{
"name": "jiq",
"version": "0.0.2",
"description": "Use existing javascript knowledge to query or mutate data",
"keywords": ["javascript inline query", "json query", "json inline query", "json", "yaml", "query"],
"main": "build/index.js",
"author": {
"name": "Adil",
"email": "adil.sudo@gmail.com",
"url": "https://md-adil.github.io"
},
"homepage": "https://md-adil.github.io/jiq/",
"repository": {
"url": "https://md-adil.github.io/jiq/",
"type": "git"
},
"license": "MIT",
"scripts": {
"watch": "tsc -w",
"build": "tsc",
"start": "node ./build"
},
"devDependencies": {
"@types/lodash": "^4.14.165",
"@types/node": "^14.14.6"
},
"dependencies": {
"commander": "^6.2.0",
"lodash": "^4.17.20",
"yaml": "^1.10.0"
},
"bin": "./build/index.js"
}
Getting name property
jiq '.name' package.json
output
jiq
Getting all dependencies
jiq '.dependencies' package.json
output
{
"commander": "^6.2.0",
"lodash": "^4.17.20",
"yaml": "^1.10.0"
}
Getting keys of dependencies object as an array with the help of pipes
jiq '.dependencies|keys' package.json
output
commander
lodash
yaml
Chain with native javascript array functions on output array
jiq '.dependencies|keys|.map(v => v.uppercase)' package.json
output
COMMANDER
LODASH
YAML
Save output to a file
jiq '.dependencies|keys|.map(v => v.uppercase)' package.json --save deps.json
or
jiq '.dependencies|keys|.map(v => v.uppercase)' package.json --save deps.yaml
data will be converted according to file extension
Some built in helper function for array and string
Getting 2 items from top
jiq '.keywords.head(2)' package.json
output
javascript inline query
json query
$
$
hold current parsed value object
jiq '$' package.json --save package.yaml
Successfully converted json to yaml
curl https://api.github.com/users | jiq --json '.map(x => x.login)'
curl <url>
to get data from remotejiq --json
to tell jiq the file content is json'.map(x => x.login)'
iterate over array, get the login key and build a new array on top of that.Use _
as global variable
curl https://api.github.com/users | jiq --json '.map(x => x.login).map(_.upperFirst)'
'.map(v => v.uppercase)'
.map(v => v.lowercase)
.map(v => v.camelcase)
.map(v => v.upperfirst)
.map(v => v.capitalize)
.map(v => v.kebabcase)
.map(v => v.limit(10))
return max 10 charsRead full documentation here.
FAQs
Use existing javascript knowledge to query or modify data
The npm package jiq receives a total of 3 weekly downloads. As such, jiq popularity was classified as not popular.
We found that jiq demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
Security News
Results from the 2023 State of JavaScript Survey highlight key trends, including Vite's dominance, rising TypeScript adoption, and the enduring popularity of React. Discover more insights on developer preferences and technology usage.
Security News
The US Justice Department has penalized two consulting firms $11.3 million for failing to meet cybersecurity requirements on federally funded projects, emphasizing strict enforcement to protect sensitive government data.