![]() ![]() Showing the latest stable release for PEP. Showing the latest stable release for QUnit. ![]() jQuery Color With Names (last two together) 2.2.0 - uncompressed, minified.jQuery Color SVG Color Names 2.2.0 - uncompressed, minified.jQuery Color 2.2.0 - uncompressed, minified.Showing the latest stable release for jQuery Color. Showing the latest stable release for jQuery Mobile. jQuery UI 1.12.1 - uncompressed, minified.jQuery UI 1.13.2 - uncompressed, minifiedīase black-tie blitzer cupertino dark-hive dot-luv eggplant excite-bike flick hot-sneaks humanity le-frog mint-choc overcast pepper-grinder redmond smoothness south-street start sunny swanky-purse trontastic ui-darkness ui-lightness vader.Showing the latest stable release for the current and legacy release families. jQuery Migrate 3.4.1 - uncompressed, minified.jQuery Core 1.12.4 - uncompressed, minified.jQuery Core 2.2.4 - uncompressed, minified.jQuery Core 3.7.0 - uncompressed, minified, slim, slim minified.The DSL for filtering, querying, and creating JSON goes much deeper than what I’ve covered here, so see for the full documentation.Showing the latest stable release in each major branch. Jq is awesome and makes working with JSON in bash easy. We have a huge front-end monolith with a single package.json that has 250 dependencies ?, so some automated assistance was necessary. I used something similar to this recently at work to prune unused dependencies. There’s more that could be done to the grep-ing in that script to make it more robust, but that’s the basic gist. We tell it to start a bash subshell where our grep_dep function is called with it’s args P 4 defines the concurrency, so 4 concurrent greps Let’s say we have JSON that looks like this: defines the replacement string where the dependency string will get placed Luckily, it’s really intuitive (unlike awk ?). Also like sed or awk, it basically has it’s own domain specific language (DSL) for querying JSON. ![]() Jq works similarly to sed or awk - like a filter that you pipe to and extract values from. See jq’s install help page for how to install on other environments. Jq isn’t a built-in command in any environment, so you have to install it. To me, bash is more expressive and succinct for certain tasks than node is. For most automation tasks, I like to use bash whenever possible because it’s faster and even more portable (I can share a bash script with team members that don’t have node.js installed). To filter with jq we can make use of the select (booleanexpression) function, which takes an expression as argument that needs to return True for elements that should be kept. Why not just use node.js when you need to deal with JSON? Limiting the result set by applying a filter helps in navigating through a large data set. By making JSON easy to work with in bash, jq opens up a lot of automation possibilities that otherwise required me to write something in node.js (which isn’t bad, it just takes longer generally). Jq can simplify the above bash to this: curl -s "" | jq '.value.joke' ![]() Luckily there’s a better way using a tool called jq. You have to pipe to 4 different utilities just to get to a property in the JSON response body! Bash doesn’t understand JSON out of the box, and using the typical text manipulation tools like grep, sed, or awk, gets difficult. That’s tough to read and even tougher to write. (Note: the above code was taken from, which is a great article). Perhaps you’ve seen or even written bash that looks like this: curl -s '' \ ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |