
Security News
RubyGems Adds Cooldown Feature to Bundler for Newly Published Gems
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.
proxy-git.cwkhome.fun/sibprogrammer/xq
Advanced tools
Command-line XML and HTML beautifier and content extractor.

Format an XML file and highlight the syntax:
xq test/data/xml/unformatted.xml
xq also accepts input through stdin:
curl -s https://www.w3schools.com/xml/note.xml | xq
HTML content can be formatted and highlighted as well (using -m flag):
xq -m test/data/html/formatted.html
It is possible to extract the content using XPath query language.
-x parameter accepts XPath expression.
Extract the text content of all nodes with city name:
cat test/data/xml/unformatted.xml | xq -x //city
Extract the value of attribute named status and belonging to user:
cat test/data/xml/unformatted.xml | xq -x /user/@status
See https://en.wikipedia.org/wiki/XPath for details.
It is possible to use CSS selector to extract the content as well:
cat test/data/html/unformatted.html | xq -q "body > p"
Extract an attribute value instead of node content additional option --attr (-a) can be used:
cat test/data/html/unformatted.html | xq -q "head > script" -a "src"
Extract part of HTML with tags (not only text content) using CSS selector:
cat test/data/html/unformatted.html | xq -n -q "head"
Output the result as JSON:
cat test/data/xml/unformatted.xml | xq -j
This will output the result in JSON format, preserving the XML structure. The JSON output will be an object where:
The preferable ways to install the utility are described below.
For macOS, via Homebrew:
brew install xq
For macOS, via MacPorts:
sudo port install xq
For Linux using custom installer:
curl -sSL https://bit.ly/install-xq | sudo bash
For Ubuntu 22.10 or higher via package manager:
apt-get install xq
For Fedora via package manager:
dnf install xq
A more detailed list of Linux distros that package the xq utility can be found here:
https://repology.org/project/xq-sibprogrammer/versions
If you have Go toolchain installed, you can use the following command to install xq:
go install github.com/sibprogrammer/xq@latest
You can play with the xq utility using the Dockerized environment:
docker-compose run --rm xq
xq /opt/examples/xml/unformatted.xml
FAQs
Unknown package
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
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.