{"id":312324,"date":"2020-10-30T21:01:19","date_gmt":"2020-10-30T21:01:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=312324"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=312324","title":{"rendered":"jsqry \u2014 \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c jq"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p>\u0412 \u0441\u0432\u043e\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/post\/303624\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435<\/a> \u044f \u043f\u0438\u0441\u0430\u043b \u043f\u0440\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/jsqry\/jsqry\" rel=\"nofollow\">Jsqry<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (DSL) \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c JSON. \u0421 \u0442\u0435\u0445 \u043f\u043e\u0440 \u043f\u0440\u043e\u0448\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0442\u043e\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430 \u0441\u0432\u043e\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0432\u043e\u0434 \u0434\u043b\u044f \u0433\u043e\u0440\u0434\u043e\u0441\u0442\u0438 \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 98% \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u043a\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u0430\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e \u043d\u0435\u0439.<\/p>\n<p>  <\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u043c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u0432\u0430\u0441 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c <a href=\"https:\/\/stedolan.github.io\/jq\/\" rel=\"nofollow\"><code>jq<\/code><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 JSON \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445. \u042f \u0442\u043e\u0436\u0435 \u044f\u0432\u043b\u044f\u043b\u0441\u044f \u0435\u0451 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u041d\u043e \u043c\u0435\u043d\u044f \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u043b\u0430 \u043d\u0435\u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0435\u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u044d\u0442\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b. \u0418 \u043d\u0435 \u043c\u0435\u043d\u044f \u043e\u0434\u043d\u043e\u0433\u043e, \u0432\u043e\u0442 \u043b\u0438\u0448\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0438\u0442\u0430\u0442 \u0441 <a href=\"https:\/\/news.ycombinator.com\/\" rel=\"nofollow\">hacker news<\/a>:<\/p>\n<p>  <\/p>\n<blockquote><p>I have been using jq for years and still can&#8217;t get it to work quite how I would expect it to.<\/p>\n<p>  I have the same issue with jq. I need to use my google fu to figure out how to do anything more than a simple select.<\/p>\n<p>  I don&#8217;t know what the term would be, mental model, but I just can&#8217;t get jq to click. Mostly because i only need it every once in a while. It&#8217;s frustrating for me because it seems quite powerful.<\/p>\n<p>  I know I might be a dissenting opinion here, but I can never wrap my head around <code>jq<\/code>. I can manage <code>jq .<\/code>, <code>jq .foo<\/code> and <code>jq -r<\/code>, but beyond that, the DSL is just opaque to me.<\/p>\n<p>  Let&#8217;s just say it: jq is an amazing tool, but the DSL is just bad.<\/p>\n<p>  Yeah, I find jq similar to writing regexes: I always have to look up the syntax, only get it working after some confusion why my patterns aren&#8217;t matching, then forget it all in a few days so have to relearn it again later.<\/p><\/blockquote>\n<p>\u041e\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u043e\u043c, \u0432\u044b \u0443\u0436\u0435 \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c. \u041f\u0440\u0438\u0448\u043b\u0430 \u0438\u0434\u0435\u044f, \u0430 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u043c\u043e\u044e JS \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. <a name=\"habracut\"><\/a>\u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u043d\u044e\u0430\u043d\u0441. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 JS \u0438 <a href=\"https:\/\/github.com\/jsqry\/jsqry.github.io\/blob\/master\/README.md\" rel=\"nofollow\">\u0435\u0451 DSL<\/a> \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 JS. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c JS-runtime \u0432 \u0441\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<p>  <\/p>\n<h2 id=\"jsqry---graalvm-edition\">jsqry \u2014 GraalVM edition<\/h2>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432 \u0442\u0435\u043c\u0435 (\u043d\u0435\u0443\u0436\u0435\u043b\u0438 \u0435\u0449\u0435 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435? oO) \u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e <a href=\"https:\/\/www.graalvm.org\/\" rel=\"nofollow\">GraalVM<\/a> \u044d\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u043a\u0430\u0447\u0430\u043d\u043d\u0430\u044f JVM \u043e\u0442 Oracle \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u0441\u0430\u043c\u044b\u0435 \u0437\u0430\u043c\u0435\u0442\u043d\u044b\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u041f\u043e\u043b\u0438\u0433\u043b\u043e\u0442\u043d\u0430\u044f JVM \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Java, Javascript, Python, Ruby, R, \u0438 \u0442.\u0434. \u043a\u043e\u0434\u0430<\/li>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 AOT-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u2014 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f Java \u043f\u0440\u044f\u043c\u043e \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a<\/li>\n<li>\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0432 JIT-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0435 Java.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u041e\u0441\u0432\u0435\u0436\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e Graal \u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 <a href=\"https:\/\/habr.com\/ru\/company\/haulmont\/blog\/433432\/\">\u044d\u0442\u043e\u0439 \u0445\u0430\u0431\u0440\u0430-\u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 1. \u0438 2. \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u2014 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 JS \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b. <\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0440\u043e\u0434\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli\" rel=\"nofollow\">https:\/\/github.com\/jsqry\/jsqry-cli<\/a>. \u041f\u0440\u0430\u0432\u0434\u0430, \u043d\u0435 \u0441\u043f\u0435\u0448\u0438\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438 \u2014 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 deprecated. \u0418\u0434\u0435\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0440\u0430\u0431\u043e\u0447\u0435\u0439, \u043d\u043e \u043d\u0435\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u043e\u0439. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0441\u044f 99 \u041c\u0431. \u041a\u0430\u043a-\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u0422\u0435\u043c \u0431\u043e\u043b\u0435\u0435, \u0435\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 <code>jq<\/code> \u0441 \u0435\u0451 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 3.7 \u041c\u0431 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/stedolan\/jq\/releases\/tag\/jq-1.6\" rel=\"nofollow\">\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0434\u043b\u044f Linux 64<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0440\u0435\u0448\u0438\u043b \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043a\u0430\u043a \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u0437 Java + JS \u043a\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 GraalVM.<\/p>\n<p>  <\/p>\n<h2 id=\"nebolshoy-obzor-etogo-resheniya\">\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u0437\u043e\u0440 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli\/blob\/master\/src\/main\/java\/com\/github\/jsqry\/cli\/App.java\" rel=\"nofollow\">App.java<\/a>. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e java-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/commons.apache.org\/proper\/commons-cli\/\" rel=\"nofollow\">Apache Commons CLI<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 java-\u043a\u043e\u0434 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u0434 \u043d\u0430 javascript \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0445\u0441\u044f \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 src\/main\/resources.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u0412\u0440\u043e\u0434\u0435-\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438\u0437 \u0440\u0435\u0441\u0443\u0440\u0441\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">scripts.add(new String(Files.readAllBytes(Paths.get(jsFileResource.toURI()))));<\/code><\/pre>\n<p>  <\/p>\n<p>\u043f\u043e\u0434 \u0413\u0440\u0430\u0430\u043b\u0435\u043c (\u0442\u043e \u0435\u0441\u0442\u044c, \u0431\u0443\u0434\u0443\u0447\u0438 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/www.graalvm.org\/reference-manual\/native-image\/\" rel=\"nofollow\">native-image<\/a>) \u043f\u0430\u0434\u0430\u043b\u043e \u0441<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">java.nio.file.FileSystemNotFoundException: Provider &quot;resource&quot; not installed<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0440\u0443\u0447\u0438\u043b \u0434\u0440\u0435\u0432\u043d\u0438\u0439 &quot;\u0445\u0430\u043a&quot; \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 <code>InputStream<\/code><\/p>\n<p>  <\/p>\n<pre><code class=\"java\">scripts.add(new Scanner(jsFileResource.openStream()).useDelimiter(&quot;\\\\A&quot;).next());<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u0440\u043e\u0447\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u043d\u0430\u0434\u0435\u044f\u0442\u044c\u0441\u044f \u043d\u0430 100% \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0432\u0441\u0435\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 Java \u0413\u0440\u0430\u0430\u043b\u0435\u043c \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u043a\u043e\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c <a href=\"https:\/\/github.com\/oracle\/graal\/issues\/1163\" rel=\"nofollow\">\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 java.awt.Graphics<\/a>. \u042d\u0442\u043e \u043f\u043e\u043c\u0435\u0448\u0430\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c GraalVM \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 AWS Lambda \u0434\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a. <\/p>\n<p>  <\/p>\n<h2 id=\"jsqry---quickjs-edition\">jsqry \u2014 QuickJS edition<\/h2>\n<p>  <\/p>\n<p>\u0413\u0434\u0435-\u0442\u043e \u0432 \u044d\u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u044f \u0443\u0437\u043d\u0430\u043b \u043e \u043d\u043e\u0432\u043e\u043c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u043c \u0434\u0432\u0438\u0436\u043a\u0435 JS <a href=\"https:\/\/bellard.org\/quickjs\/\" rel=\"nofollow\">QuickJS<\/a> \u043e\u0442 \u0433\u0435\u043d\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%91%D0%B5%D0%BB%D0%BB%D0%B0%D1%80,_%D0%A4%D0%B0%D0%B1%D1%80%D0%B8%D1%81\" rel=\"nofollow\">\u0424\u0430\u0431\u0440\u0438\u0441\u0430 \u0411\u0435\u043b\u043b\u0430\u0440\u0430<\/a>. \u0412 \u0441\u0432\u043e\u0435\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435\u0441\u0451\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 <code>qjsc<\/code> \u0434\u0436\u0430\u0432\u0430\u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b. \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043d\u0430\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 ES2020. \u0422\u043e \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e! <\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u0442\u043e\u0440\u0430\u044f \u0438\u043d\u043a\u0430\u0440\u043d\u0430\u0446\u0438\u044f CLI-\u0432\u0435\u0440\u0441\u0438\u0438 <code>jsqry<\/code>: <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\" rel=\"nofollow\">https:\/\/github.com\/jsqry\/jsqry-cli2<\/a>.<br \/>  \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0436\u0438\u0437\u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u043c \u0438 \u0443\u0436\u0435 \u043f\u0440\u0438\u043d\u0435\u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u043b\u0438\u0437\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u0436\u0435 \u0442\u0430\u043a\u043e\u0435 <code>jsqry<\/code>?<\/p>\n<p>  <\/p>\n<p><code>jsqry<\/code> \u044d\u0442\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 (\u043f\u043e\u0445\u043e\u0436\u0430\u044f \u043d\u0430 <a href=\"https:\/\/stedolan.github.io\/jq\/\" rel=\"nofollow\">jq<\/a>) \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a JSON \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f &quot;\u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u0439&quot; DSL.<\/p>\n<p>  <\/p>\n<p>\u0426\u0435\u043b\u044c \u044d\u0442\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u2014 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b JS \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/jsqry\/jsqry\" rel=\"nofollow\">jsqry<\/a> \u0432 \u0444\u043e\u0440\u043c\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. <\/p>\n<p>  <\/p>\n<h2 id=\"primery-ispolzovaniya\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<h4 id=\"zapros\">\u0437\u0430\u043f\u0440\u043e\u0441<\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ echo '[{&quot;name&quot;:&quot;John&quot;,&quot;age&quot;:30},          {&quot;name&quot;:&quot;Alice&quot;,&quot;age&quot;:25},          {&quot;name&quot;:&quot;Bob&quot;,&quot;age&quot;:50}]' | jsqry 'name' [   &quot;John&quot;,   &quot;Alice&quot;,   &quot;Bob&quot; ]<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"pervyy-element\">\u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ echo '[{&quot;name&quot;:&quot;John&quot;,&quot;age&quot;:30},          {&quot;name&quot;:&quot;Alice&quot;,&quot;age&quot;:25},          {&quot;name&quot;:&quot;Bob&quot;,&quot;age&quot;:50}]' | jsqry -1 'name' &quot;John&quot;<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"ispolzovanie-parametrizacii-zaprosa\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ echo '[{&quot;name&quot;:&quot;John&quot;,&quot;age&quot;:30},{&quot;name&quot;:&quot;Alice&quot;,&quot;age&quot;:25},{&quot;name&quot;:&quot;Bob&quot;,&quot;age&quot;:50}]' \\     | jsqry '[ _.age&gt;=? &amp;&amp; _.name.toLowerCase().startsWith(?) ]' --arg 30 --arg-str joh  [   {     &quot;name&quot;: &quot;John&quot;,     &quot;age&quot;: 30   } ]<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"ispolzovanie-v-roli-prostogo-json-pretty-printer\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0440\u043e\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e JSON pretty-printer<\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ echo '[{&quot;name&quot;:&quot;John&quot;,&quot;age&quot;:30},{&quot;name&quot;:&quot;Alice&quot;,&quot;age&quot;:25},{&quot;name&quot;:&quot;Bob&quot;,&quot;age&quot;:50}]' \\  | jsqry [   {     &quot;name&quot;: &quot;John&quot;,     &quot;age&quot;: 30   },   {     &quot;name&quot;: &quot;Alice&quot;,     &quot;age&quot;: 25   },   {     &quot;name&quot;: &quot;Bob&quot;,     &quot;age&quot;: 50   } ]<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0445\u043e\u0434\u043d\u043e\u0439 JSON \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d. \u0418 \u0440\u0430\u0441\u043a\u0440\u0430\u0448\u0435\u043d!<\/p>\n<p>  <\/p>\n<h4 id=\"chto-to-bolee-hitroe\">\u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0445\u0438\u0442\u0440\u043e\u0435<\/h4>\n<p>  <\/p>\n<p>\u041e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0431\u043e\u043b\u044c\u0448\u0435 2, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 100, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e \u0438 \u0432\u0437\u044f\u0442\u044c 2 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u044f \u044d\u0442\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043a\u043e\u043b\u044c \u0443\u0433\u043e\u0434\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. <a href=\"https:\/\/jsqry.github.io\/\" rel=\"nofollow\">\u0423\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u043c DSL<\/a>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ echo '[1,2,3,4,5]' | jsqry '[_&gt;2] {_+100} s(-_) [-2:]' [   104,   103 ]<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"polnaya-mosch-js\">\u043f\u043e\u043b\u043d\u0430\u044f \u043c\u043e\u0449\u044c JS<\/h4>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <code>jsqry<\/code> \u0432\u043c\u0435\u0449\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 <a href=\"https:\/\/bellard.org\/quickjs\/\" rel=\"nofollow\">JS-\u0434\u0432\u0438\u0436\u043e\u043a<\/a> \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043c\u0435\u043d\u0435\u0435 1 \u041c\u0431, \u043f\u043e\u043b\u043d\u0430\u044f \u043c\u043e\u0449\u044c JS \u0432 \u0432\u0430\u0448\u0438\u0445 \u0440\u0443\u043a\u0430\u0445!<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ echo '[&quot;HTTP:\/\/EXAMPLE.COM\/123&quot;,           &quot;https:\/\/www.Google.com\/search?q=test&quot;,           &quot;https:\/\/www.YouTube.com\/watch?v=_OBlgSz8sSM&quot;]' \\  | jsqry '{ _.match(\/:\\\/\\\/([^\\\/]+)\\\/\/)[1].toLowerCase() }' [   &quot;example.com&quot;,   &quot;www.google.com&quot;,   &quot;www.youtube.com&quot; ]<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"help-soobschenie\">help-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435<\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ jsqry jsqry ver. 0.1.2 Usage: echo $JSON | jsqry 'query'  -1,--first     return first result element  -h,--help      print help and exit  -v,--version   print version and exit  -c,--compact   compact output (no pretty-print)  -u,--unquote   unquote output string(s)  -as ARG,  --arg-str ARG  supply string query argument  -a ARG,  --arg ARG      supply query argument of any other type<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"nebolshoe-sravnenie-s-jq\">\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 <code>jq<\/code><\/h2>\n<p>  <\/p>\n<p>\u0410 <a href=\"https:\/\/gist.github.com\/xonixx\/d6066e83ec0773df248141440b18e8e4\" rel=\"nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 <code>jq<\/code> \u0438 <code>jsqry<\/code> \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. <\/p>\n<p>  <\/p>\n<h2 id=\"ustanovka\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h2>\n<p>  <\/p>\n<p>\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f (\u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f): <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/releases\/tag\/v0.1.2\" rel=\"nofollow\">0.1.2<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0442\u043e\u043b\u044c\u043a\u043e Linux x64 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043e\u0440\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448\u0435\u0439 \u043f\u043e\u043c\u043e\u0449\u0438. <\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443, \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0443\u044e \u043d\u0438\u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ sudo bash -e -c &quot; wget https:\/\/github.com\/jsqry\/jsqry-cli2\/releases\/download\/v0.1.2\/jsqry-linux-amd64 -O\/usr\/local\/bin\/jsqry chmod +x \/usr\/local\/bin\/jsqry echo \\&quot;jsqry \\$(jsqry -v) installed successfully\\&quot;  &quot;<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"o-testirovanii-cli-utility\">\u041e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 CLI-\u0443\u0442\u0438\u043b\u0438\u0442\u044b<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043d\u0430 GitHub \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u042e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u044b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0441\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0434\u0435\u043b\u043e \u043e\u0431\u0441\u0442\u043e\u0438\u0442, \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c CLI-\u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u043a\u0430\u043a \u0435\u0434\u0438\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0435, \u043a\u0430\u043a \u0447\u0435\u0440\u043d\u044b\u0439 \u044f\u0449\u0438\u043a. \u0411\u043b\u0430\u0433\u043e, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0442\u043e, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u0449\u0438\u043a\u0438 \u0431\u044b \u043d\u0430\u0437\u0432\u0430\u043b\u0438 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A7%D0%B8%D1%81%D1%82%D0%BE%D1%82%D0%B0_%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B8\" rel=\"nofollow\">\u0447\u0438\u0441\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439<\/a> \u2014 \u0432\u044b\u0445\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0445\u043e\u0434\u043e\u043c.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043f\u044b\u0442\u0430\u0432 \u0413\u0443\u0433\u043b \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u0432\u0438\u0434\u0430 &quot;bash unit testing&quot; \u0438 \u043e\u0442\u043c\u0435\u0442\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b <a href=\"https:\/\/opensource.com\/article\/19\/2\/testing-bash-bats\" rel=\"nofollow\">BATS<\/a>, <a href=\"https:\/\/shellspec.info\/\" rel=\"nofollow\">ShellSpec<\/a>, <a href=\"https:\/\/bach.sh\/\" rel=\"nofollow\">Bach<\/a> \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u043a\u0430\u043a \u0447\u0435\u0440\u0435\u0441\u0447\u0443\u0440 \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0435 \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (<a href=\"https:\/\/xkcd.ru\/927\/\" rel=\"nofollow\">\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043f\u0440\u043e 14 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432<\/a>), \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 <a href=\"https:\/\/github.com\/adolfopa\/tush\" rel=\"nofollow\">tush<\/a>, \u0433\u0435\u043d\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0432 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435. <\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u0441\u0442\u044b \u043d\u0430 <code>tush<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0435<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ command --that --should --execute correctly | expected stdout output  $ command --that --will --cause error @ expected stderr output ? expected-exit-code<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0447\u0435\u043c <code>tush<\/code> \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043d\u0430 <code>$<\/code>, <code>|<\/code>, <code>@<\/code> \u0438 <code>?<\/code> \u2014 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0435\u0441\u0442\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043d\u0430 <code>$<\/code> \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0441 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <code>diff<\/code>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u0442\u0435\u0441\u0442 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u0435\u0439, \u0430 diff \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ \/bin\/bash \/home\/xonix\/proj\/jsqry-cli2\/tests.sh --- tests.tush expected +++ tests.tush actual @@ -1,5 +1,5 @@  $ jsqry -v -| 0.1.2 +| 0.1.1   $ jsqry -h  | jsqry ver. 0.1.1 !!! TESTS FAILED !!!<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<br \/>  <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/blob\/master\/tests.tush\" rel=\"nofollow\">tests.tush<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0446\u0435\u043d\u043d\u043e, \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u0440\u043e\u043b\u044c, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044f \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0423\u0434\u0430\u043b\u043e\u0441\u044c \u044d\u0442\u043e\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/blob\/master\/.github\/workflows\/run-tests.yml\" rel=\"nofollow\">\u0432 \u0432\u0438\u0434\u0435 GitHub Action<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043c\u0438\u0442, \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0431\u0435\u0439\u0434\u0436:<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/actions?query=workflow%3A%22Build+and+test%22\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/workflows\/Build%20and%20test\/badge.svg\" alt=\"Build and test\"><\/a><\/p>\n<p>  <\/p>\n<h2 id=\"drugie-osobennosti-resheniya\">\u0414\u0440\u0443\u0433\u0438\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<h3 id=\"raskrashivanie-json\">\u0420\u0430\u0441\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u043d\u0438\u0435 JSON<\/h3>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0441\u043a\u0440\u0430\u0441\u043a\u0443 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e JSON \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435 <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/blob\/master\/colorJson.js\" rel=\"nofollow\">\u043f\u0440\u043e\u0441\u0442\u043e<\/a>. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <a href=\"https:\/\/github.com\/zvakanaka\/color-json\" rel=\"nofollow\">zvakanaka\/color-json<\/a> \u0441 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0446\u0432\u0435\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043d\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0435\u0439\u0448\u0435\u0433\u043e StackOverflow <a href=\"https:\/\/stackoverflow.com\/a\/28938235\/104522\" rel=\"nofollow\">\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f<\/a>. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u043a\u0440\u0430\u0441\u043a\u0438 \u0441 <code>jq<\/code>. \u0412 \u043c\u043e\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u043e\u043b\u0435\u0435 \u044f\u0440\u043a\u0438\u0435, \u0430 null \u0438\u043c\u0435\u0435\u0442 \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0434\u043b\u044f \u043f\u0443\u0449\u0435\u0439 \u0437\u0430\u043c\u0435\u0442\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/209\/266\/93e\/20926693e23f6abdc12bb2ca99f36912.png\" alt=\"screenshot\"><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0440\u0430\u0441\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043e\u043c.<\/p>\n<p>  <\/p>\n<h3 id=\"podklyuchenie-npm-versii-biblioteki-v-quickjs\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 npm-\u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 QuickJS<\/h3>\n<p>  <\/p>\n<p>\u041e\u043f\u0438\u0448\u0443 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 <a href=\"https:\/\/www.npmjs.com\/package\/jsqry\" rel=\"nofollow\">npm-\u0432\u0435\u0440\u0441\u0438\u044f<\/a> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>jsqry<\/code> \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/blob\/master\/package.json\" rel=\"nofollow\">package.json<\/a> \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432\u044b\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c <code>npm i<\/code>. \u0417\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/blob\/master\/prepare-for-qjs.py\" rel=\"nofollow\">prepare-for-qjs.py<\/a>, \u0440\u043e\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0437\u0430\u043c\u0435\u043d\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0441\u0442\u0438\u043b\u0435 nodejs \u043d\u0430 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0441\u0442\u0438\u043b\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 ES, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0432\u0438\u0436\u043a\u043e\u043c QuickJS. \u0414\u0430\u043b\u0435\u0435 \u0443\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u0443\u0442\u0438\u043b\u0438\u0442\u044b <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/blob\/master\/jsqry-cli.js\" rel=\"nofollow\">jsqry-cli.js<\/a>.<\/p>\n<p>  <\/p>\n<h3 id=\"chtenie-vhodnoy-stroki-v-utf-8-v-quickjs\">\u0427\u0442\u0435\u043d\u0438\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 UTF-8 \u0432 QuickJS<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 QuickJS \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0440\u043e\u043a\u0438 \u0441\u0442\u043e\u0438\u0442 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 stdin. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <a href=\"https:\/\/bellard.org\/quickjs\/quickjs.html#Standard-library\" rel=\"nofollow\">\u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u0430\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/a>, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u0432 QuickJS, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0439\u0442\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/blob\/master\/jsqry-cli.js#L8\" rel=\"nofollow\">\u0440\u0443\u0447\u043d\u043e\u0439 \u043a\u043e\u0434<\/a>, \u0447\u0442\u043e\u0431 \u043f\u0435\u0440\u0435\u0433\u043d\u0430\u0442\u044c \u0431\u0430\u0439\u0442\u0438\u043a\u0438 UTF-8 \u0432 JS-\u0441\u0442\u0440\u043e\u043a\u0443. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c, \u0430 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 QuickJS: <a href=\"https:\/\/github.com\/twardoch\/svgop\" rel=\"nofollow\">twardoch\/svgop<\/a>. <\/p>\n<p>  <\/p>\n<h3 id=\"sborka-utility\">\u0421\u0431\u043e\u0440\u043a\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u044b<\/h3>\n<p>  <\/p>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/blob\/master\/build.sh\" rel=\"nofollow\">build.sh<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e &quot;\u0444\u0438\u0448\u0435\u043a&quot; \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u2014 \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 \u0442\u0435\u0441\u0442\u043e\u0432 <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/blob\/master\/tests.sh\" rel=\"nofollow\">tests.sh<\/a>. \u042d\u0442\u043e \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u0430 \u0441\u0431\u043e\u0440\u043a\u0430 \u0440\u0430\u0437\u0432\u0430\u043b\u0438\u0442\u0441\u044f \u0435\u0441\u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b.<\/p>\n<p>  <\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0435 \u2014 \u0441\u043a\u0440\u0438\u043f\u0442 <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/blob\/master\/build.sh\" rel=\"nofollow\">build.sh<\/a> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e QuickJS, \u0430 \u0441\u043a\u0440\u0438\u043f\u0442 <a href=\"https:\/\/github.com\/jsqry\/jsqry-cli2\/blob\/master\/tests.sh\" rel=\"nofollow\">tests.sh<\/a> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u043e \u0436\u0435 \u0434\u043b\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <code>tush<\/code>. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u2014 \u043c\u043e\u0436\u043d\u043e \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0442\u0435\u043b\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<p>\u0422\u0440\u0435\u0442\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u0412 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>ls -lh jsqry<\/code> \u0447\u0442\u043e\u0431 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b, \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043d\u043e\u0438\u0434\u0430\u043b\u0435\u043d \u043d\u0430 \u044d\u0442\u043e\u0442 \u0441\u0447\u0435\u0442, \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0447\u0442\u043e\u0431 CLI-\u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0438\u043c\u0435\u043b\u0430 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440. \u042f \u0440\u0430\u0434, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u043d\u0435\u0441\u043b\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c <a href=\"https:\/\/www.freelists.org\/post\/quickjs-devel\/Increased-compiled-binary-size-with-latest-quickjs-release-20200705\" rel=\"nofollow\">\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044e<\/a>, \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0440\u0435\u043b\u0438\u0437\u043e\u0432 QuickJS.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 652 KB. \u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0447\u0442\u043e \u0444\u0430\u0439\u043b \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 JS. <\/p>\n<p>  <\/p>\n<h2 id=\"v-kachestve-poslesloviya\">\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0448\u0443 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u043a\u0430\u043a \u0437\u0430\u043c\u0435\u043d\u0443 <code>jq<\/code>. \u0422\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u0432\u0430\u0448\u0438 \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043f\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043a\u0440\u0438\u0442\u0438\u043a\u0443.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/525808\/\"> https:\/\/habr.com\/ru\/post\/525808\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p>\u0412 \u0441\u0432\u043e\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/post\/303624\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435<\/a> \u044f \u043f\u0438\u0441\u0430\u043b \u043f\u0440\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/jsqry\/jsqry\" rel=\"nofollow\">Jsqry<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (DSL) \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c JSON. \u0421 \u0442\u0435\u0445 \u043f\u043e\u0440 \u043f\u0440\u043e\u0448\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0442\u043e\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430 \u0441\u0432\u043e\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0432\u043e\u0434 \u0434\u043b\u044f \u0433\u043e\u0440\u0434\u043e\u0441\u0442\u0438 \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 98% \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u043a\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u0430\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e \u043d\u0435\u0439.<\/p>\n<p>  <\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u043c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u0432\u0430\u0441 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c <a href=\"https:\/\/stedolan.github.io\/jq\/\" rel=\"nofollow\"><code>jq<\/code><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 JSON \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445. \u042f \u0442\u043e\u0436\u0435 \u044f\u0432\u043b\u044f\u043b\u0441\u044f \u0435\u0451 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u041d\u043e \u043c\u0435\u043d\u044f \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u043b\u0430 \u043d\u0435\u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0435\u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u044d\u0442\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b. \u0418 \u043d\u0435 \u043c\u0435\u043d\u044f \u043e\u0434\u043d\u043e\u0433\u043e, \u0432\u043e\u0442 \u043b\u0438\u0448\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0438\u0442\u0430\u0442 \u0441 <a href=\"https:\/\/news.ycombinator.com\/\" rel=\"nofollow\">hacker news<\/a>:<\/p>\n<p>  <\/p>\n<blockquote><p>I have been using jq for years and still can&#8217;t get it to work quite how I would expect it to.<\/p>\n<p>  I have the same issue with jq. I need to use my google fu to figure out how to do anything more than a simple select.<\/p>\n<p>  I don&#8217;t know what the term would be, mental model, but I just can&#8217;t get jq to click. Mostly because i only need it every once in a while. It&#8217;s frustrating for me because it seems quite powerful.<\/p>\n<p>  I know I might be a dissenting opinion here, but I can never wrap my head around <code>jq<\/code>. I can manage <code>jq .<\/code>, <code>jq .foo<\/code> and <code>jq -r<\/code>, but beyond that, the DSL is just opaque to me.<\/p>\n<p>  Let&#8217;s just say it: jq is an amazing tool, but the DSL is just bad.<\/p>\n<p>  Yeah, I find jq similar to writing regexes: I always have to look up the syntax, only get it working after some confusion why my patterns aren&#8217;t matching, then forget it all in a few days so have to relearn it again later.<\/p><\/blockquote>\n<p>\u041e\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u043e\u043c, \u0432\u044b \u0443\u0436\u0435 \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c. \u041f\u0440\u0438\u0448\u043b\u0430 \u0438\u0434\u0435\u044f, \u0430 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u043c\u043e\u044e JS \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-312324","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312324","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=312324"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312324\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=312324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=312324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=312324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}