@port-labs/jq-node-bindings 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +5 -0
- package/.jshintignore +1 -0
- package/.jshintrc +23 -0
- package/binding.gyp +56 -0
- package/configure +26 -0
- package/deps/jq/.gitattributes +2 -0
- package/deps/jq/.travis.yml +53 -0
- package/deps/jq/AUTHORS +73 -0
- package/deps/jq/COPYING +70 -0
- package/deps/jq/ChangeLog +1349 -0
- package/deps/jq/Makefile.am +198 -0
- package/deps/jq/NEWS +88 -0
- package/deps/jq/README.md +64 -0
- package/deps/jq/builtin.c +1684 -0
- package/deps/jq/builtin.h +10 -0
- package/deps/jq/bytecode.c +161 -0
- package/deps/jq/bytecode.h +92 -0
- package/deps/jq/compile-ios.sh +102 -0
- package/deps/jq/compile.c +1210 -0
- package/deps/jq/compile.h +101 -0
- package/deps/jq/config/m4/check-math-func.m4 +4 -0
- package/deps/jq/config/m4/find-func-no-libs.m4 +8 -0
- package/deps/jq/config/m4/find-func-no-libs2.m4 +62 -0
- package/deps/jq/config/m4/find-func.m4 +9 -0
- package/deps/jq/config/m4/misc.m4 +3 -0
- package/deps/jq/configure.ac +221 -0
- package/deps/jq/docs/Gemfile +7 -0
- package/deps/jq/docs/Gemfile.lock +63 -0
- package/deps/jq/docs/README.md +25 -0
- package/deps/jq/docs/Rakefile +145 -0
- package/deps/jq/docs/content/1.tutorial/default.yml +327 -0
- package/deps/jq/docs/content/2.download/default.yml +117 -0
- package/deps/jq/docs/content/3.manual/manual.yml +2878 -0
- package/deps/jq/docs/content/3.manual/v1.3/manual.yml +1270 -0
- package/deps/jq/docs/content/3.manual/v1.4/manual.yml +1672 -0
- package/deps/jq/docs/content/index/index.yml +51 -0
- package/deps/jq/docs/default_manpage.md +22 -0
- package/deps/jq/docs/public/.htaccess +28 -0
- package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.css +1058 -0
- package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.min.css +9 -0
- package/deps/jq/docs/public/bootstrap/css/bootstrap.css +5224 -0
- package/deps/jq/docs/public/bootstrap/css/bootstrap.min.css +9 -0
- package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings-white.png +0 -0
- package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings.png +0 -0
- package/deps/jq/docs/public/bootstrap/js/bootstrap.js +2027 -0
- package/deps/jq/docs/public/bootstrap/js/bootstrap.min.js +6 -0
- package/deps/jq/docs/public/css/base.scss +99 -0
- package/deps/jq/docs/public/jq.png +0 -0
- package/deps/jq/docs/public/robots.txt +2 -0
- package/deps/jq/docs/site.yml +18 -0
- package/deps/jq/docs/templates/default.liquid +34 -0
- package/deps/jq/docs/templates/index.liquid +60 -0
- package/deps/jq/docs/templates/manual.liquid +122 -0
- package/deps/jq/docs/templates/shared/_footer.liquid +5 -0
- package/deps/jq/docs/templates/shared/_head.liquid +12 -0
- package/deps/jq/docs/templates/shared/_header.liquid +26 -0
- package/deps/jq/exec_stack.h +112 -0
- package/deps/jq/execute.c +1155 -0
- package/deps/jq/inject_errors.c +112 -0
- package/deps/jq/jq.1.default +39 -0
- package/deps/jq/jq.1.prebuilt +3075 -0
- package/deps/jq/jq.h +60 -0
- package/deps/jq/jq.spec +70 -0
- package/deps/jq/jq_parser.h +9 -0
- package/deps/jq/jq_test.c +346 -0
- package/deps/jq/jv.c +1333 -0
- package/deps/jq/jv.h +240 -0
- package/deps/jq/jv_alloc.c +179 -0
- package/deps/jq/jv_alloc.h +27 -0
- package/deps/jq/jv_aux.c +619 -0
- package/deps/jq/jv_dtoa.c +4275 -0
- package/deps/jq/jv_dtoa.h +22 -0
- package/deps/jq/jv_file.c +49 -0
- package/deps/jq/jv_parse.c +852 -0
- package/deps/jq/jv_print.c +348 -0
- package/deps/jq/jv_unicode.c +96 -0
- package/deps/jq/jv_unicode.h +11 -0
- package/deps/jq/jv_utf8_tables.h +37 -0
- package/deps/jq/lexer.c +2442 -0
- package/deps/jq/lexer.h +362 -0
- package/deps/jq/lexer.l +184 -0
- package/deps/jq/libm.h +160 -0
- package/deps/jq/linker.c +393 -0
- package/deps/jq/linker.h +7 -0
- package/deps/jq/locfile.c +91 -0
- package/deps/jq/locfile.h +29 -0
- package/deps/jq/m4/ax_compare_version.m4 +177 -0
- package/deps/jq/m4/ax_prog_bison_version.m4 +68 -0
- package/deps/jq/main.c +566 -0
- package/deps/jq/opcode_list.h +44 -0
- package/deps/jq/parser.c +3914 -0
- package/deps/jq/parser.h +193 -0
- package/deps/jq/parser.y +923 -0
- package/deps/jq/scripts/crosscompile +42 -0
- package/deps/jq/scripts/gen_utf8_tables.py +32 -0
- package/deps/jq/scripts/version +5 -0
- package/deps/jq/setup.sh +33 -0
- package/deps/jq/tests/jq.test +1235 -0
- package/deps/jq/tests/jqtest +5 -0
- package/deps/jq/tests/mantest +7 -0
- package/deps/jq/tests/modules/.jq +5 -0
- package/deps/jq/tests/modules/a.jq +2 -0
- package/deps/jq/tests/modules/b/b.jq +2 -0
- package/deps/jq/tests/modules/c/c.jq +16 -0
- package/deps/jq/tests/modules/c/d.jq +1 -0
- package/deps/jq/tests/modules/data.json +4 -0
- package/deps/jq/tests/modules/lib/jq/e/e.jq +1 -0
- package/deps/jq/tests/modules/lib/jq/f.jq +1 -0
- package/deps/jq/tests/modules/syntaxerror/syntaxerror.jq +1 -0
- package/deps/jq/tests/modules/test_bind_order.jq +4 -0
- package/deps/jq/tests/modules/test_bind_order0.jq +1 -0
- package/deps/jq/tests/modules/test_bind_order1.jq +2 -0
- package/deps/jq/tests/modules/test_bind_order2.jq +2 -0
- package/deps/jq/tests/onig.supp +21 -0
- package/deps/jq/tests/onig.test +85 -0
- package/deps/jq/tests/onigtest +5 -0
- package/deps/jq/tests/setup +36 -0
- package/deps/jq/tests/shtest +205 -0
- package/deps/jq/tests/torture/input0.json +7 -0
- package/deps/jq/util.c +462 -0
- package/deps/jq/util.h +64 -0
- package/deps/jq.gyp +35 -0
- package/index.d.ts +3 -0
- package/jest.config.js +10 -0
- package/lib/index.js +14 -0
- package/package.json +48 -0
- package/reports/jest-port-api.xml +35 -0
- package/src/binding.cc +177 -0
- package/src/binding.h +13 -0
- package/test/santiy.test.js +122 -0
- package/util/configure.js +27 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
headline: Tutorial
|
|
2
|
+
body:
|
|
3
|
+
- text: |
|
|
4
|
+
|
|
5
|
+
GitHub has a JSON API, so let's play with that. This URL gets us the last
|
|
6
|
+
5 commits from the jq repo.
|
|
7
|
+
|
|
8
|
+
- command: "curl 'https://api.github.com/repos/stedolan/jq/commits?per_page=5'"
|
|
9
|
+
result: |
|
|
10
|
+
[
|
|
11
|
+
{
|
|
12
|
+
"sha": "d25341478381063d1c76e81b3a52e0592a7c997f",
|
|
13
|
+
"commit": {
|
|
14
|
+
"author": {
|
|
15
|
+
"name": "Stephen Dolan",
|
|
16
|
+
"email": "mu@netsoc.tcd.ie",
|
|
17
|
+
"date": "2013-06-22T16:30:59Z"
|
|
18
|
+
},
|
|
19
|
+
"committer": {
|
|
20
|
+
"name": "Stephen Dolan",
|
|
21
|
+
"email": "mu@netsoc.tcd.ie",
|
|
22
|
+
"date": "2013-06-22T16:30:59Z"
|
|
23
|
+
},
|
|
24
|
+
"message": "Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",
|
|
25
|
+
"tree": {
|
|
26
|
+
"sha": "6ab697a8dfb5a96e124666bf6d6213822599fb40",
|
|
27
|
+
"url": "https://api.github.com/repos/stedolan/jq/git/trees/6ab697a8dfb5a96e124666bf6d6213822599fb40"
|
|
28
|
+
},
|
|
29
|
+
"url": "https://api.github.com/repos/stedolan/jq/git/commits/d25341478381063d1c76e81b3a52e0592a7c997f",
|
|
30
|
+
"comment_count": 0
|
|
31
|
+
},
|
|
32
|
+
"url": "https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f",
|
|
33
|
+
"html_url": "https://github.com/stedolan/jq/commit/d25341478381063d1c76e81b3a52e0592a7c997f",
|
|
34
|
+
"comments_url": "https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f/comments",
|
|
35
|
+
"author": {
|
|
36
|
+
"login": "stedolan",
|
|
37
|
+
...
|
|
38
|
+
|
|
39
|
+
- text: |
|
|
40
|
+
|
|
41
|
+
GitHub returns nicely formatted JSON. For servers that don't, it can be
|
|
42
|
+
helpful to pipe the response through jq to pretty-print it. The simplest
|
|
43
|
+
jq program is the expression `.`, which takes the input and produces it
|
|
44
|
+
unchanged as output.
|
|
45
|
+
|
|
46
|
+
- command: "curl 'https://api.github.com/repos/stedolan/jq/commits?per_page=5' | jq '.'"
|
|
47
|
+
result: |
|
|
48
|
+
[
|
|
49
|
+
{
|
|
50
|
+
"sha": "d25341478381063d1c76e81b3a52e0592a7c997f",
|
|
51
|
+
"commit": {
|
|
52
|
+
"author": {
|
|
53
|
+
"name": "Stephen Dolan",
|
|
54
|
+
"email": "mu@netsoc.tcd.ie",
|
|
55
|
+
"date": "2013-06-22T16:30:59Z"
|
|
56
|
+
},
|
|
57
|
+
"committer": {
|
|
58
|
+
"name": "Stephen Dolan",
|
|
59
|
+
"email": "mu@netsoc.tcd.ie",
|
|
60
|
+
"date": "2013-06-22T16:30:59Z"
|
|
61
|
+
},
|
|
62
|
+
"message": "Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",
|
|
63
|
+
"tree": {
|
|
64
|
+
"sha": "6ab697a8dfb5a96e124666bf6d6213822599fb40",
|
|
65
|
+
"url": "https://api.github.com/repos/stedolan/jq/git/trees/6ab697a8dfb5a96e124666bf6d6213822599fb40"
|
|
66
|
+
},
|
|
67
|
+
"url": "https://api.github.com/repos/stedolan/jq/git/commits/d25341478381063d1c76e81b3a52e0592a7c997f",
|
|
68
|
+
"comment_count": 0
|
|
69
|
+
},
|
|
70
|
+
"url": "https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f",
|
|
71
|
+
"html_url": "https://github.com/stedolan/jq/commit/d25341478381063d1c76e81b3a52e0592a7c997f",
|
|
72
|
+
"comments_url": "https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f/comments",
|
|
73
|
+
"author": {
|
|
74
|
+
"login": "stedolan",
|
|
75
|
+
...
|
|
76
|
+
|
|
77
|
+
- text: |
|
|
78
|
+
|
|
79
|
+
We can use jq to extract just the first commit.
|
|
80
|
+
|
|
81
|
+
- command: "curl 'https://api.github.com/repos/stedolan/jq/commits?per_page=5' | jq '.[0]'"
|
|
82
|
+
result: |
|
|
83
|
+
{
|
|
84
|
+
"sha": "d25341478381063d1c76e81b3a52e0592a7c997f",
|
|
85
|
+
"commit": {
|
|
86
|
+
"author": {
|
|
87
|
+
"name": "Stephen Dolan",
|
|
88
|
+
"email": "mu@netsoc.tcd.ie",
|
|
89
|
+
"date": "2013-06-22T16:30:59Z"
|
|
90
|
+
},
|
|
91
|
+
"committer": {
|
|
92
|
+
"name": "Stephen Dolan",
|
|
93
|
+
"email": "mu@netsoc.tcd.ie",
|
|
94
|
+
"date": "2013-06-22T16:30:59Z"
|
|
95
|
+
},
|
|
96
|
+
"message": "Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",
|
|
97
|
+
"tree": {
|
|
98
|
+
"sha": "6ab697a8dfb5a96e124666bf6d6213822599fb40",
|
|
99
|
+
"url": "https://api.github.com/repos/stedolan/jq/git/trees/6ab697a8dfb5a96e124666bf6d6213822599fb40"
|
|
100
|
+
},
|
|
101
|
+
"url": "https://api.github.com/repos/stedolan/jq/git/commits/d25341478381063d1c76e81b3a52e0592a7c997f",
|
|
102
|
+
"comment_count": 0
|
|
103
|
+
},
|
|
104
|
+
"url": "https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f",
|
|
105
|
+
"html_url": "https://github.com/stedolan/jq/commit/d25341478381063d1c76e81b3a52e0592a7c997f",
|
|
106
|
+
"comments_url": "https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f/comments",
|
|
107
|
+
"author": {
|
|
108
|
+
"login": "stedolan",
|
|
109
|
+
"id": 79765,
|
|
110
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/79765?v=3",
|
|
111
|
+
"gravatar_id": "",
|
|
112
|
+
"url": "https://api.github.com/users/stedolan",
|
|
113
|
+
"html_url": "https://github.com/stedolan",
|
|
114
|
+
"followers_url": "https://api.github.com/users/stedolan/followers",
|
|
115
|
+
"following_url": "https://api.github.com/users/stedolan/following{/other_user}",
|
|
116
|
+
"gists_url": "https://api.github.com/users/stedolan/gists{/gist_id}",
|
|
117
|
+
"starred_url": "https://api.github.com/users/stedolan/starred{/owner}{/repo}",
|
|
118
|
+
"subscriptions_url": "https://api.github.com/users/stedolan/subscriptions",
|
|
119
|
+
"organizations_url": "https://api.github.com/users/stedolan/orgs",
|
|
120
|
+
"repos_url": "https://api.github.com/users/stedolan/repos",
|
|
121
|
+
"events_url": "https://api.github.com/users/stedolan/events{/privacy}",
|
|
122
|
+
"received_events_url": "https://api.github.com/users/stedolan/received_events",
|
|
123
|
+
"type": "User",
|
|
124
|
+
"site_admin": false
|
|
125
|
+
},
|
|
126
|
+
"committer": {
|
|
127
|
+
"login": "stedolan",
|
|
128
|
+
"id": 79765,
|
|
129
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/79765?v=3",
|
|
130
|
+
"gravatar_id": "",
|
|
131
|
+
"url": "https://api.github.com/users/stedolan",
|
|
132
|
+
"html_url": "https://github.com/stedolan",
|
|
133
|
+
"followers_url": "https://api.github.com/users/stedolan/followers",
|
|
134
|
+
"following_url": "https://api.github.com/users/stedolan/following{/other_user}",
|
|
135
|
+
"gists_url": "https://api.github.com/users/stedolan/gists{/gist_id}",
|
|
136
|
+
"starred_url": "https://api.github.com/users/stedolan/starred{/owner}{/repo}",
|
|
137
|
+
"subscriptions_url": "https://api.github.com/users/stedolan/subscriptions",
|
|
138
|
+
"organizations_url": "https://api.github.com/users/stedolan/orgs",
|
|
139
|
+
"repos_url": "https://api.github.com/users/stedolan/repos",
|
|
140
|
+
"events_url": "https://api.github.com/users/stedolan/events{/privacy}",
|
|
141
|
+
"received_events_url": "https://api.github.com/users/stedolan/received_events",
|
|
142
|
+
"type": "User",
|
|
143
|
+
"site_admin": false
|
|
144
|
+
},
|
|
145
|
+
"parents": [
|
|
146
|
+
{
|
|
147
|
+
"sha": "54b9c9bdb225af5d886466d72f47eafc51acb4f7",
|
|
148
|
+
"url": "https://api.github.com/repos/stedolan/jq/commits/54b9c9bdb225af5d886466d72f47eafc51acb4f7",
|
|
149
|
+
"html_url": "https://github.com/stedolan/jq/commit/54b9c9bdb225af5d886466d72f47eafc51acb4f7"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"sha": "8b1b503609c161fea4b003a7179b3fbb2dd4345a",
|
|
153
|
+
"url": "https://api.github.com/repos/stedolan/jq/commits/8b1b503609c161fea4b003a7179b3fbb2dd4345a",
|
|
154
|
+
"html_url": "https://github.com/stedolan/jq/commit/8b1b503609c161fea4b003a7179b3fbb2dd4345a"
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
- text: |
|
|
160
|
+
|
|
161
|
+
For the rest of the examples, I'll leave out the `curl` command - it's not
|
|
162
|
+
going to change.
|
|
163
|
+
|
|
164
|
+
There's a lot of info we don't care about there, so we'll restrict it down
|
|
165
|
+
to the most interesting fields.
|
|
166
|
+
|
|
167
|
+
- command: "jq '.[0] | {message: .commit.message, name: .commit.committer.name}'"
|
|
168
|
+
result: |
|
|
169
|
+
{
|
|
170
|
+
"message": "Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",
|
|
171
|
+
"name": "Stephen Dolan"
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
- text: |
|
|
175
|
+
|
|
176
|
+
The `|` operator in jq feeds the output of one filter (`.[0]` which gets
|
|
177
|
+
the first element of the array in the response) into the input of another
|
|
178
|
+
(`{...}` which builds an object out of those fields). You can access
|
|
179
|
+
nested attributes, such as `.commit.message`.
|
|
180
|
+
|
|
181
|
+
Now let's get the rest of the commits.
|
|
182
|
+
|
|
183
|
+
- command: "jq '.[] | {message: .commit.message, name: .commit.committer.name}'"
|
|
184
|
+
result: |
|
|
185
|
+
{
|
|
186
|
+
"message": "Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",
|
|
187
|
+
"name": "Stephen Dolan"
|
|
188
|
+
}
|
|
189
|
+
{
|
|
190
|
+
"message": "Reject all overlong UTF8 sequences.",
|
|
191
|
+
"name": "Stephen Dolan"
|
|
192
|
+
}
|
|
193
|
+
{
|
|
194
|
+
"message": "Fix various UTF8 parsing bugs.\n\nIn particular, parse bad UTF8 by replacing the broken bits with U+FFFD\nand resychronise correctly after broken sequences.",
|
|
195
|
+
"name": "Stephen Dolan"
|
|
196
|
+
}
|
|
197
|
+
{
|
|
198
|
+
"message": "Fix example in manual for `floor`. See #155.",
|
|
199
|
+
"name": "Stephen Dolan"
|
|
200
|
+
}
|
|
201
|
+
{
|
|
202
|
+
"message": "Document floor",
|
|
203
|
+
"name": "Nicolas Williams"
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
- text: |
|
|
207
|
+
|
|
208
|
+
`.[]` returns each element of the array returned in the response, one at a
|
|
209
|
+
time, which are all fed into
|
|
210
|
+
`{message: .commit.message, name: .commit.committer.name}`.
|
|
211
|
+
|
|
212
|
+
Data in jq is represented as streams of JSON values - every jq
|
|
213
|
+
expression runs for each value in its input stream, and can
|
|
214
|
+
produce any number of values to its output stream.
|
|
215
|
+
|
|
216
|
+
Streams are serialised by just separating JSON values with
|
|
217
|
+
whitespace. This is a `cat`-friendly format - you can just join
|
|
218
|
+
two JSON streams together and get a valid JSON stream.
|
|
219
|
+
|
|
220
|
+
If you want to get the output as a single array, you can tell jq to
|
|
221
|
+
"collect" all of the answers by wrapping the filter in square
|
|
222
|
+
brackets:
|
|
223
|
+
|
|
224
|
+
- command: "jq '[.[] | {message: .commit.message, name: .commit.committer.name}]'"
|
|
225
|
+
result: |
|
|
226
|
+
[
|
|
227
|
+
{
|
|
228
|
+
"message": "Merge pull request #163 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",
|
|
229
|
+
"name": "Stephen Dolan"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"message": "Reject all overlong UTF8 sequences.",
|
|
233
|
+
"name": "Stephen Dolan"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"message": "Fix various UTF8 parsing bugs.\n\nIn particular, parse bad UTF8 by replacing the broken bits with U+FFFD\nand resychronise correctly after broken sequences.",
|
|
237
|
+
"name": "Stephen Dolan"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"message": "Fix example in manual for `floor`. See #155.",
|
|
241
|
+
"name": "Stephen Dolan"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"message": "Document floor",
|
|
245
|
+
"name": "Nicolas Williams"
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
|
+
|
|
249
|
+
- text: |
|
|
250
|
+
|
|
251
|
+
- - -
|
|
252
|
+
|
|
253
|
+
Next, let's try getting the URLs of the parent commits out of the
|
|
254
|
+
API results as well. In each commit, the GitHub API includes information
|
|
255
|
+
about "parent" commits. There can be one or many.
|
|
256
|
+
|
|
257
|
+
"parents": [
|
|
258
|
+
{
|
|
259
|
+
"sha": "54b9c9bdb225af5d886466d72f47eafc51acb4f7",
|
|
260
|
+
"url": "https://api.github.com/repos/stedolan/jq/commits/54b9c9bdb225af5d886466d72f47eafc51acb4f7",
|
|
261
|
+
"html_url": "https://github.com/stedolan/jq/commit/54b9c9bdb225af5d886466d72f47eafc51acb4f7"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"sha": "8b1b503609c161fea4b003a7179b3fbb2dd4345a",
|
|
265
|
+
"url": "https://api.github.com/repos/stedolan/jq/commits/8b1b503609c161fea4b003a7179b3fbb2dd4345a",
|
|
266
|
+
"html_url": "https://github.com/stedolan/jq/commit/8b1b503609c161fea4b003a7179b3fbb2dd4345a"
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
|
|
270
|
+
We want to pull out all of the "html_url" fields inside that array of parent
|
|
271
|
+
commits and make a simple list of strings to go along with the
|
|
272
|
+
"message" and "author" fields we already have.
|
|
273
|
+
|
|
274
|
+
- command: "jq '[.[] | {message: .commit.message, name: .commit.committer.name, parents: [.parents[].html_url]}]'"
|
|
275
|
+
result: |
|
|
276
|
+
[
|
|
277
|
+
{
|
|
278
|
+
"message": "Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",
|
|
279
|
+
"name": "Stephen Dolan",
|
|
280
|
+
"parents": [
|
|
281
|
+
"https://github.com/stedolan/jq/commit/54b9c9bdb225af5d886466d72f47eafc51acb4f7",
|
|
282
|
+
"https://github.com/stedolan/jq/commit/8b1b503609c161fea4b003a7179b3fbb2dd4345a"
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"message": "Reject all overlong UTF8 sequences.",
|
|
287
|
+
"name": "Stephen Dolan",
|
|
288
|
+
"parents": [
|
|
289
|
+
"https://github.com/stedolan/jq/commit/ff48bd6ec538b01d1057be8e93b94eef6914e9ef"
|
|
290
|
+
]
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"message": "Fix various UTF8 parsing bugs.\n\nIn particular, parse bad UTF8 by replacing the broken bits with U+FFFD\nand resychronise correctly after broken sequences.",
|
|
294
|
+
"name": "Stephen Dolan",
|
|
295
|
+
"parents": [
|
|
296
|
+
"https://github.com/stedolan/jq/commit/54b9c9bdb225af5d886466d72f47eafc51acb4f7"
|
|
297
|
+
]
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"message": "Fix example in manual for `floor`. See #155.",
|
|
301
|
+
"name": "Stephen Dolan",
|
|
302
|
+
"parents": [
|
|
303
|
+
"https://github.com/stedolan/jq/commit/3dcdc582ea993afea3f5503a78a77675967ecdfa"
|
|
304
|
+
]
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"message": "Document floor",
|
|
308
|
+
"name": "Nicolas Williams",
|
|
309
|
+
"parents": [
|
|
310
|
+
"https://github.com/stedolan/jq/commit/7c4171d414f647ab08bcd20c76a4d8ed68d9c602"
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
]
|
|
314
|
+
|
|
315
|
+
- text: |
|
|
316
|
+
|
|
317
|
+
Here we're making an object as before, but this time the `parents`
|
|
318
|
+
field is being set to `[.parents[].html_url]`, which collects
|
|
319
|
+
all of the parent commit URLs defined in the parents object.
|
|
320
|
+
|
|
321
|
+
- text: |
|
|
322
|
+
|
|
323
|
+
- - -
|
|
324
|
+
|
|
325
|
+
Here endeth the tutorial! There's lots more to play with. Go
|
|
326
|
+
read [the manual](../manual/) if you're interested, and [download
|
|
327
|
+
jq](../download/) if you haven't already.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
headline: Download jq
|
|
2
|
+
body:
|
|
3
|
+
|
|
4
|
+
- text: |
|
|
5
|
+
|
|
6
|
+
jq is written in C and has no runtime dependencies, so it should be
|
|
7
|
+
possible to build it for nearly any platform. Prebuilt binaries are
|
|
8
|
+
available for Linux, OS X and Windows.
|
|
9
|
+
|
|
10
|
+
The binaries should just run, but on OS X and Linux you may need
|
|
11
|
+
to make them executable first using `chmod +x jq`.
|
|
12
|
+
|
|
13
|
+
jq is licensed under the MIT license. For all of the gory
|
|
14
|
+
details, read the file `COPYING` in the source distribution.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Linux
|
|
18
|
+
|
|
19
|
+
* jq 1.4 binaries for [64-bit](linux64/jq) or [32-bit](linux32/jq) systems.
|
|
20
|
+
* jq 1.3 binaries for [64-bit](linux64/jq-1.3/jq) or [32-bit](linux32/jq-1.3/jq) systems.
|
|
21
|
+
|
|
22
|
+
* For Arch users, a PKGBUILD for jq-1.1 is in the
|
|
23
|
+
[AUR](https://aur.archlinux.org/packages.php?ID=63849), as
|
|
24
|
+
well as a PKGBUILD for the HEAD of master
|
|
25
|
+
([jq-git](https://aur.archlinux.org/packages.php?ID=63850)).
|
|
26
|
+
You can install them using
|
|
27
|
+
[Yaourt](https://wiki.archlinux.org/index.php/Yaourt) or
|
|
28
|
+
manually by following instructions on [Arch Linux's
|
|
29
|
+
Wiki](https://wiki.archlinux.org/index.php/Arch_UseRepository).
|
|
30
|
+
|
|
31
|
+
* jq 1.4 is in the official [Debian](https://packages.debian.org/jq) and
|
|
32
|
+
[Ubuntu](http://packages.ubuntu.com/jq) repositories. Install using
|
|
33
|
+
`sudo apt-get install jq`.
|
|
34
|
+
|
|
35
|
+
* jq 1.4 is [in Debian](http://packages.debian.org/jq)
|
|
36
|
+
|
|
37
|
+
* jq 1.3.2 is in the official Fedora repository. You can install using
|
|
38
|
+
`sudo yum install jq`.
|
|
39
|
+
|
|
40
|
+
### OS X
|
|
41
|
+
|
|
42
|
+
* `brew install jq` using [homebrew](http://mxcl.github.com/homebrew/)
|
|
43
|
+
|
|
44
|
+
* Or, grab prebuilt jq 1.4 [64-bit binaries](osx64/jq) or [32-bit
|
|
45
|
+
binaries](osx32/jq)
|
|
46
|
+
|
|
47
|
+
* Or, grab prebuilt jq 1.3 [64-bit binaries](osx64/jq-1.3/jq) or [32-bit
|
|
48
|
+
binaries](osx32/jq-1.3/jq)
|
|
49
|
+
|
|
50
|
+
### Solaris
|
|
51
|
+
|
|
52
|
+
* `pkgutil -i jq` in [OpenCSW](http://www.opencsw.org/p/jq) for Solaris 10+, Sparc and x86
|
|
53
|
+
|
|
54
|
+
* jq 1.4 executables for Solaris 11 [64-bit](solaris11-64/jq) or [32-bit](solaris11-32/jq)
|
|
55
|
+
|
|
56
|
+
### Windows
|
|
57
|
+
|
|
58
|
+
* `chocolatey install jq` using [Chocolatey NuGet](https://chocolatey.org/)
|
|
59
|
+
|
|
60
|
+
* jq 1.4 executables for [64-bit](win64/jq.exe) or [32-bit](win32/jq.exe)
|
|
61
|
+
|
|
62
|
+
* jq 1.3 executables for [64-bit](win64/jq-1.3/jq-1.3.exe) or [32-bit](win32/jq-1.3/jq-1.3.exe)
|
|
63
|
+
|
|
64
|
+
### From source on Linux, OS X, Cygwin, and other POSIX-like operating systems
|
|
65
|
+
|
|
66
|
+
* [Source tarball for jq 1.4](source/jq-1.4.tar.gz)
|
|
67
|
+
|
|
68
|
+
You can build it using the usual `./configure && make && sudo
|
|
69
|
+
make install` rigmarole.
|
|
70
|
+
|
|
71
|
+
If you're interested in using the lastest development version, try:
|
|
72
|
+
|
|
73
|
+
git clone https://github.com/stedolan/jq.git
|
|
74
|
+
cd jq
|
|
75
|
+
autoreconf -i
|
|
76
|
+
./configure
|
|
77
|
+
make
|
|
78
|
+
sudo make install
|
|
79
|
+
|
|
80
|
+
To build it from a git clone, you'll need to install a few
|
|
81
|
+
packages first:
|
|
82
|
+
|
|
83
|
+
* [Flex](http://flex.sourceforge.net/)
|
|
84
|
+
* [Bison](https://www.gnu.org/software/bison/)
|
|
85
|
+
* [GCC](https://gcc.gnu.org)
|
|
86
|
+
* [Make](https://www.gnu.org/software/make/)
|
|
87
|
+
* [Autotools](https://www.gnu.org/software/automake/)
|
|
88
|
+
|
|
89
|
+
For Linux systems, these will all be in your system's package
|
|
90
|
+
manager, and if you do development on the machine they're most
|
|
91
|
+
likely already installed.
|
|
92
|
+
|
|
93
|
+
On OS X, these are all included in Apple's command line tools, which can
|
|
94
|
+
be installed from [Xcode](https://developer.apple.com/xcode/). However,
|
|
95
|
+
you may find that you need a newer version of Bison than the one provided
|
|
96
|
+
by Apple. This can be found in [Homebrew](http://brew.sh) or
|
|
97
|
+
[MacPorts](https://macports.org/).
|
|
98
|
+
|
|
99
|
+
`flex` and `bison` are used to generate the lexer and parser for
|
|
100
|
+
jq. For jq 1.5, neither is required if you use `./configure
|
|
101
|
+
--disable-maintainer-mode` instead of `./configure`. This flag says to use
|
|
102
|
+
the pre-generated lexer and parser that come with the code.
|
|
103
|
+
|
|
104
|
+
#### Building the documentation
|
|
105
|
+
|
|
106
|
+
jq's documentation is compiled into static HTML using
|
|
107
|
+
[Bonsai](http://www.tinytree.info). To view the documentation
|
|
108
|
+
locally, run `rake serve` (or `bundle exec rake serve`) from the
|
|
109
|
+
docs/ subdirectory. To build the docs just `rake build` from the
|
|
110
|
+
docs subdirectory. You'll need a few Ruby dependencies, which can
|
|
111
|
+
be installed by following the instructions in `docs/README.md`.
|
|
112
|
+
|
|
113
|
+
The man page is built by `make jq.1`, or just `make`, also from
|
|
114
|
+
the YAML docs, and you'll still need the Ruby dependencies to
|
|
115
|
+
build the manpage.
|
|
116
|
+
|
|
117
|
+
|