Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 367 lines (242 sloc) 10.065 kb
2451c95 Trent Mick json 1.3.1: Start fleshing out module usage as 'jsontool'.
authored
1 # json (aka jsontool) Changelog
2
d842680 Trent Mick a good start at json3
authored
3 Note: json3 is still pretty new. Use accordingly. Feedback very welcome!
5db770c Trent Mick GH markdown doesn't support that second para in a list item. Move this n...
authored
4 For convenience for the first few json3 releases a "json2" command is
5 installed to be able to test/compare new vs. old behaviour.
6
d842680 Trent Mick a good start at json3
authored
7
4cd38af Trent Mick prep for future dev
authored
8 ## json 3.0.2 (not yet released)
9
10 (nothing yet)
11
12
b13f302 Trent Mick prepare for 3.0.1 release
authored
13 ## json 3.0.1
c58c580 Trent Mick prep for future dev
authored
14
c1a05b1 Trent Mick fix a bogus json dep
authored
15 - Fix a bogus 'json' dep.
c58c580 Trent Mick prep for future dev
authored
16
17
d4a517d Trent Mick prepare for 3.0.0 release
authored
18 ## json 3.0.0
07bfcc1 Trent Mick move this note up in changelog
authored
19
c385800 Trent Mick more json 3 prep
authored
20 - Switched to json 3.x dev on master. "2.x" branch created for any
d842680 Trent Mick a good start at json3
authored
21 necessary 2.x releases. See the
22 [2.x changelog here](https://github.com/trentm/json/blob/2.x/CHANGES.md).
23
24 - [Backward incompatible] A significant change to 'jsony' default output and
25 some use cases to increase utility. These changes necessitated a few
26 backward incompatible changes. However, care was take to only break
27 compat for (a) rare use cases and (b) where utility was much improved.
28 See <https://github.com/trentm/json/wiki/backward-incompat-json-3-changes>
29 for full details of backward incompatible changes.
30
31 - New "conditional filtering" via the `-c CODE` option. If the input is an
32 array, then `-c` will automatically switch to processing each element
33 of the array. Example:
34
35 $ echo '[{"name":"trent", "age":38}, {"name":"ewan", "age":4}]' \
36 | json3 -c 'age>21'
37 [
38 {
39 "name": "trent",
40 "age": 38
41 }
42 ]
43
44 - Change `-e CODE` option to automatically switch to array processing if
45 the input is an array. This matches the behaviour of the new `-c CODE`
46 option. Example:
47
48 $ echo '[{"name":"trent", "age":38}, {"name":"ewan", "age":4}]' \
49 | json3 -e 'age++' -o json-0
50 [{"name":"trent","age":39},{"name":"ewan","age":5}]
51
52 - New '-A' option to force `-e` and `-c` to process an input array as a
53 single item.
54
55 - Add [ansidiff](https://github.com/trentm/ansidiff)-based colored diffs
56 for test suite failures.
b202fb7 Trent Mick prep for future dev
authored
57
45102c9 Trent Mick [issue #26] Add support for escapes in the delimiter given by `-d DELIM`
authored
58 - [issue #26] Add support for escapes in the delimiter given by `-d DELIM`:
59
60 $ echo '[{"one":"un","two":"deux"},{"one":"uno","two":"dos"}]' \
61 | jsondev -a -d'\t' one two
62 un deux
63 uno dos
64
b202fb7 Trent Mick prep for future dev
authored
65
218f065 Trent Mick prepare for 2.2.1 release
authored
66 ## json 2.2.1
31f192b Trent Mick prep for next release
authored
67
b53c481 Trent Mick issue #24 workaround: avoid 'process.stdout cannot be closed' errors fro...
authored
68 - Hack workaround for issue #24 to not get a spurious "process.stdout cannot be
d9c716f Trent Mick issue #24: note on the guard
authored
69 closed" from current node 0.6 versions. Note: currently this guard is only
70 applied for node v0.6.0..v0.6.8 inclusive.
31f192b Trent Mick prep for next release
authored
71
72
69fba88 Trent Mick prepare for 2.2.0 release
authored
73 ## json 2.2.0
2480e73 Trent Mick json 2.2.0: add '-e CODE' argument for input processing
authored
74
75 - New "-e CODE" option to execute the given code on the input object; or,
76 if '-a/--array' is given, then on each item in the input array. Execution
77 is done before filtering.
78
79 $ echo '{"age": 38}' | json -e 'this.age++'
80 {
81 "age": 39
82 }
6a470a2 Trent Mick prep for future dev
authored
83
84
6adbb49 Trent Mick prepare for 2.1.0 release
authored
85 ## json 2.1.0
e4b9042 Trent Mick json 1.2.0; show location and context for syntax errors
authored
86
87 - Improve error message when input is not JSON to include context and line
88 and column position. This is implemented using a JSON parser from
89 (<https://github.com/douglascrockford/JSON-js>). Example:
90
91 $ echo "[1,,2]" | json
92 json: error: input is not JSON: Unexpected ',' at line 1, column 4:
93 [1,,2]
94 ...^
95 [1,,2]
3e89842 Trent Mick prep for future dev
authored
96
97
50583f5 Trent Mick prepare for 2.0.3 release
authored
98 ## json 2.0.3
dc64427 Trent Mick prep for future dev
authored
99
0071b7b Trent Mick arrayification changes: adjacent arrays flatten, no mixing objects and a...
authored
100 - Auto-arrayification: Drop support for arrayifying an array adjacent to
101 an object. I.e. only arrayify adjacent objects *or* adjacent arrays.
102
103 - Auto-arrayification: Change "arrayification" of adjacent *arrays* to be
104 a single flat arrays of the input arrays' elements. Before:
d842680 Trent Mick a good start at json3
authored
105
0071b7b Trent Mick arrayification changes: adjacent arrays flatten, no mixing objects and a...
authored
106 $ echo '[1,2][3,4]' | bin/json
107 [
108 [
109 1,
110 2,
111 ],
112 [
113 3,
114 4
115 ]
116 ]
117
c43748c Trent Mick markdown fixes
authored
118 and now:
0071b7b Trent Mick arrayification changes: adjacent arrays flatten, no mixing objects and a...
authored
119
120 $ echo '[1,2][3,4]' | bin/json
121 [
122 1,
123 2,
124 3,
125 4
126 ]
127
c43748c Trent Mick markdown fixes
authored
128 This is expected to be more useful in practice.
0071b7b Trent Mick arrayification changes: adjacent arrays flatten, no mixing objects and a...
authored
129
c43748c Trent Mick markdown fixes
authored
130 - Auto-arrayification: Allow JSON objects (or arrays) to be "arrayified"
131 if not separated by any space. Previously a newline (at least) separation
132 was required. So, for example, the following now works:
8eb3054 Trent Mick Improve auto-arrayification to allow objects separated by no space.
authored
133
134 $ echo '{"a":1}{"b":2}' | bin/json -o json-0
135 [{"a":1},{"b":2}]
136
c43748c Trent Mick markdown fixes
authored
137 The rules for auto-arrayification then are: Objects and arrays only,
138 separated by no space or space including a newline.
8eb3054 Trent Mick Improve auto-arrayification to allow objects separated by no space.
authored
139
2960950 Trent Mick changelog entry for last commit
authored
140 - Fix stdout flushing in some cases.
141
dc64427 Trent Mick prep for future dev
authored
142
c62dafb Trent Mick prepare for 2.0.2 release
authored
143 ## json 2.0.2
2a41d3a Trent Mick prep for future dev
authored
144
a12d2b1 Trent Mick node v0.6 support
authored
145 - Add node v0.6 support. Drop v0.2 and v0.3 support.
146
2a41d3a Trent Mick prep for future dev
authored
147
6bddd65 Trent Mick prepare for 2.0.1 release
authored
148 ## json 2.0.1
601c57e Trent Mick prep for future dev
authored
149
f43c627 Trent Mick [issue#23] Fix output in '-a|--array' mode if one or more keys don't exi...
authored
150 - [issue#23] Fix output in '-a|--array' mode if one or more keys don't
151 exist in one or more of the array items.
152
601c57e Trent Mick prep for future dev
authored
153
f999c33 Trent Mick prepare for 2.0.0 release
authored
154 ## json 2.0.0
01225f5 Trent Mick multiple top-level JSON objects as input
authored
155
b8b38ac Trent Mick markdown cleanups
authored
156 - '-o | --output MODE' support. Supported modes:
d842680 Trent Mick a good start at json3
authored
157
878f02a Trent Mick -o|--output MODE
authored
158 jsony (default): JSON with string quotes elided
159 json: JSON output, 2-space indent
160 json-N: JSON output, N-space indent, e.g. 'json-4'
161 inspect: node.js `util.inspect` output
45e06ae Trent Mick '-a|--array' for independently processing each element of an input array
authored
162
b8b38ac Trent Mick markdown cleanups
authored
163 - '-a|--array' for independently processing each element of an input array.
d842680 Trent Mick a good start at json3
authored
164
45e06ae Trent Mick '-a|--array' for independently processing each element of an input array
authored
165 $ echo '[
166 {
167 "name": "Trent",
168 "id": 12,
169 "email": "trent@example.com"
170 },
171 {
172 "name": "Mark",
173 "id": 13,
174 "email": "mark@example.com"
175 }
176 ]' | json -a name email
177 Trent trent@example.com
178 Mark mark@example.com
179
b8b38ac Trent Mick markdown cleanups
authored
180 This example shows that '-a' results in tabular output. The '-d' option
181 can be used to specify a delimiter other than the default single space, e.g.:
d842680 Trent Mick a good start at json3
authored
182
45e06ae Trent Mick '-a|--array' for independently processing each element of an input array
authored
183 json -d, -a field1 field2
d842680 Trent Mick a good start at json3
authored
184
b8b38ac Trent Mick markdown cleanups
authored
185 [Backward Incompatibility] This is a replacement for the experimental '*'
186 syntax in the lookup strings (previously enabled via '-x|--experimental').
187 That syntax and option has been removed.
45e06ae Trent Mick '-a|--array' for independently processing each element of an input array
authored
188
b8b38ac Trent Mick markdown cleanups
authored
189 - Add '--' option processing support and error out if an unknown option is
190 given.
45e06ae Trent Mick '-a|--array' for independently processing each element of an input array
authored
191
b8b38ac Trent Mick markdown cleanups
authored
192 - Support multiple top-level JSON objects as input to mean a list of
193 these object:
d842680 Trent Mick a good start at json3
authored
194
b8b38ac Trent Mick markdown cleanups
authored
195 $ echo '{"one": 1}
196 {"two": 1}' | ./lib/jsontool.js
197 [
198 {
199 "one": 1
200 },
201 {
202 "two": 1
203 }
204 ]
d842680 Trent Mick a good start at json3
authored
205
b8b38ac Trent Mick markdown cleanups
authored
206 This can be nice to process a stream of JSON objects generated from
207 multiple calls to another tool or `cat *.json | json`. Rules:
d842680 Trent Mick a good start at json3
authored
208
b8b38ac Trent Mick markdown cleanups
authored
209 - Only JS objects and arrays. Don't see strong need for basic
210 JS types right now and this limitation simplifies.
211 - The break between JS objects has to include a newline. I.e. good:
01225f5 Trent Mick multiple top-level JSON objects as input
authored
212
b8b38ac Trent Mick markdown cleanups
authored
213 {"one": 1}
214 {"two": 2}
01225f5 Trent Mick multiple top-level JSON objects as input
authored
215
b8b38ac Trent Mick markdown cleanups
authored
216 bad:
01225f5 Trent Mick multiple top-level JSON objects as input
authored
217
b8b38ac Trent Mick markdown cleanups
authored
218 {"one": 1}{"two": 2}
01225f5 Trent Mick multiple top-level JSON objects as input
authored
219
b8b38ac Trent Mick markdown cleanups
authored
220 This condition should be fine for typical use cases and ensures
221 no false matches inside JS strings.
b1e0f02 Trent Mick prep for future dev
authored
222
223
37ceba2 Trent Mick prepare for 1.4.1 release
authored
224 ## json 1.4.1
1e18ed4 Trent Mick prep for future dev
authored
225
999da16 Trent Mick issue #9: handle EPIPE gracefully
authored
226 - [issue #9] Gracefully handle EPIPE (i.e. stdout being closed on json before
227 it is finished writing).
228
1e18ed4 Trent Mick prep for future dev
authored
229
394544c Trent Mick prepare for 1.4.0 release
authored
230 ## json 1.4.0
37c6f08 Trent Mick issue #19: multiple lookup strings in one invocation
authored
231
232 - [issue #19] Allow multiple lookup arguments:
233
234 $ echo '{"one": 1, "two": 2}' | json one two
235 1
236 2
237
238 WARNING: This involve a backward incompatible change in the JS APIs
239 `jsontool.processDatum` and `jsontool.processDatumExperimental`.
f972613 Trent Mick prep for future dev
authored
240
241
ab1a98e Trent Mick prepare for 1.3.4 release
authored
242 ## json 1.3.4
7ef70f1 Trent Mick prep for future dev
authored
243
f4863a2 Trent Mick issue #18: fix `json --version` for standalone
authored
244 - [issue #18] Fix `json --version` for standalone mode again (was broken in json 1.3.3).
245
7ef70f1 Trent Mick prep for future dev
authored
246
ed7652d Trent Mick prepare for 1.3.3 release
authored
247 ## json 1.3.3
5b2fc3b Trent Mick issue#16: cannot use regex as a function in v8 used in node v0.5
authored
248
f4863a2 Trent Mick issue #18: fix `json --version` for standalone
authored
249 - WARNING: `json --version` is broken when running outside the source (or npm
250 install'd) tree. I.e. this is a bad release for standalone.
2bf14bc Trent Mick [issue #17] Ensure stdout is flushed on exit.
authored
251 - [issue #17] Ensure stdout is flushed on exit.
4052804 Trent Mick correction: 1.3.2 was already released, move changelog for recent change...
authored
252
253
254 ## json 1.3.2
255
2bf14bc Trent Mick [issue #17] Ensure stdout is flushed on exit.
authored
256 - [issue #16] Fix to use `<regex object>.exec` instead of using the regex
5b2fc3b Trent Mick issue#16: cannot use regex as a function in v8 used in node v0.5
authored
257 object as a function -- no longer allowed in the v8 used in node v0.5.x.
258
259
364aad7 Trent Mick following changelog conventions for cut_a_release.py
authored
260 ## json 1.3.1
2451c95 Trent Mick json 1.3.1: Start fleshing out module usage as 'jsontool'.
authored
261
262 - Make "jsontool" require'able as a module. For example, you can now:
263
264 $ npm install jsontool
265 $ node
266 > var jsontool = require('jsontool')
267 > jsontool.parseLookup('a.b.c')
268 [ 'a', 'b', 'c' ]
269 > jsontool.parseLookup('my-key.0["bar"]')
270 [ 'my-key', '0', '["bar"]' ]
271 > jsontool.main(['', '', '--help'])
272 Usage: <something generating JSON on stdout> | json [options] [lookup]
273 ...
274
275 Currently other exported API is experimental and will likely change to be
276 more generally useful (e.g. the current `processDatum` isn't all handy
277 for module usage).
278
279 Note: For command-line usage, the main module has moved from "json" to
280 "lib/jsontool.js". So, if you are not using npm, you can setup the `json`
281 command via something like:
d842680 Trent Mick a good start at json3
authored
282
2451c95 Trent Mick json 1.3.1: Start fleshing out module usage as 'jsontool'.
authored
283 alias json='.../json/lib/jsontool.js'
284
8b56edd Trent Mick [Issue 5] Fix getting a key with a period
authored
285
364aad7 Trent Mick following changelog conventions for cut_a_release.py
authored
286 ## json 1.3.0
8b3a12a Trent Mick add experimental '*' support in lookup
authored
287
09084b3 Trent Mick update notes for npm addition
authored
288 - package.json and publish to npm as "jsontool" ("json" name is taken)
8b3a12a Trent Mick add experimental '*' support in lookup
authored
289 - Add experimental support for '*' in the lookup. This will extract all
290 the elements of an array. Examples:
d842680 Trent Mick a good start at json3
authored
291
8b3a12a Trent Mick add experimental '*' support in lookup
authored
292 $ echo '["a", "b", "c"]' | json -x '*'
293 a
294 b
295 c
296 $ echo '[{"one": "un"}, {"two": "deux"}]' | json -x '*'
297 {
298 "one": "un"
299 }
300 {
301 "two": "deux"
302 }
303 $ echo '[{"foo": "bar"}, {"foo": "baz"}]' | json -x '*.foo'
304 bar
305 baz
d842680 Trent Mick a good start at json3
authored
306
8b3a12a Trent Mick add experimental '*' support in lookup
authored
307 This is still experimental because I want to feel it out (is it useful?
308 does it cause problems for regular usage?) and it is incomplete. The
1e7c3ba Trent Mick fix markdown
authored
309 second example above shows that with '\*', json can emit multiple JSON
8b3a12a Trent Mick add experimental '*' support in lookup
authored
310 documents. `json` needs to change to support *accepting* multiple JSON
311 documents.
d842680 Trent Mick a good start at json3
authored
312
8b3a12a Trent Mick add experimental '*' support in lookup
authored
313 Also, a limitation: How to extract *multiple* fields from a list of
314 objects? Is this even a necessary feature? Thinking out loud:
d842680 Trent Mick a good start at json3
authored
315
d3cf3ea Trent Mick planned syntax for multiple key extraction
authored
316 '*.{name,version}' # a la bash. Josh likes it. What else do you need?
8b3a12a Trent Mick add experimental '*' support in lookup
authored
317
318 - Add '-x|--experimental' option to turn on incomplete/experimental features.
319
320
364aad7 Trent Mick following changelog conventions for cut_a_release.py
authored
321 ## json 1.2.1
0bb4ae9 Trent Mick fix issue #12: handling output for `undefined`
authored
322
323 - [issue #12] Fix handling of output when result of lookup is `undefined`.
324
325
364aad7 Trent Mick following changelog conventions for cut_a_release.py
authored
326 ## json 1.2.0
d4b8ebf Trent Mick issue #10: fix for v0.5
authored
327
328 - [issue #10] Fix for node v0.5.
329
330
364aad7 Trent Mick following changelog conventions for cut_a_release.py
authored
331 ## json 1.1.9
eaf27a3 Trent Mick bump version for subsequent work
authored
332
3709aa8 Trent Mick issue 8: don't emit newline for empty output
authored
333 - [Issue 8] Don't emit a newline for empty output.
eaf27a3 Trent Mick bump version for subsequent work
authored
334
335
364aad7 Trent Mick following changelog conventions for cut_a_release.py
authored
336 ## json 1.1.8
a230176 Trent Mick issue 4: man page content
authored
337
6fb706b Trent Mick issue 7: Handle "HTTP/1.1 100 Continue" leading header block.
authored
338 - [Issue 7] Handle "HTTP/1.1 100 Continue" leading header block.
a230176 Trent Mick issue 4: man page content
authored
339 - [Issue 4] Add a man page (using ronnjs).
340
341
364aad7 Trent Mick following changelog conventions for cut_a_release.py
authored
342 ## json 1.1.7
8b56edd Trent Mick [Issue 5] Fix getting a key with a period
authored
343
344 - [Issue 5] Fix getting a key with a period. E.g.:
345
346 echo '{"foo.bar": 42}' | json '["foo.bar"]'
347
348 `json` is now doing much better lookup string parsing. Because escapes are
349 now handled properly you can do the equivalent a little more easily:
d842680 Trent Mick a good start at json3
authored
350
8b56edd Trent Mick [Issue 5] Fix getting a key with a period
authored
351 $ echo '{"foo.bar": 42}' | json foo\\.bar
352 42
353
354
364aad7 Trent Mick following changelog conventions for cut_a_release.py
authored
355 ## json 1.1.6
8b56edd Trent Mick [Issue 5] Fix getting a key with a period
authored
356
357 - [Issue 6] Error exit value if invalid JSON.
358
359
364aad7 Trent Mick following changelog conventions for cut_a_release.py
authored
360 ## json 1.1.4
8b56edd Trent Mick [Issue 5] Fix getting a key with a period
authored
361
362 - [Issue 2] Fix bracket notation: `echo '{"foo-bar": "baz"}' | json '["foo-bar"]'`
363
364
365 (Started maintaining this log 19 March 2011. For earlier change information
366 you'll have to dig into the commit history.)
Something went wrong with that request. Please try again.