Skip to content

Commit

Permalink
TODO updates. Mention arrayification in README.
Browse files Browse the repository at this point in the history
  • Loading branch information
trentm committed Oct 11, 2011
1 parent b8b38ac commit 08eb9fd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,25 @@ Or a hacked up "compact" output mode which prints the elements of an array on th
]


# Multiple top-level JSON objects

`json` supports "arrayifying" multiple top-level JSON objects on its input:

$ echo '{"one": 1}
{"two": 1}' | ./lib/jsontool.js
[
{
"one": 1
},
{
"two": 1
}
]

This can most often be useful when wanting to process the output of a command
that generates JSON, run multiple times.



# Test suite

Expand Down
13 changes: 6 additions & 7 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# current

- BUG: this doesn't return all content. Need to use a real fix for all stdout flush!
echo foo bar | xargs -n1 -I{} curl http://github.com/api/v2/json/issues/search/joyent/node/open/{} | bin/json
- also arrayification doesn't work for:
echo foo bar | xargs -n1 -I{} curl http://github.com/api/v2/json/issues/search/joyent/node/open/{} | bin/json
Need to consider allowing '}{' on the same line -- despite possible false positive

- update README for 'cat *.json | json' input handling
- -v|--verbose option that'll include warnings: first warning is that a
lookup bit that is '*' and '-x' was used -> obsolete warning



# top

- npm/lib/utils/minimatch.js: fnmatch/glob implementation.
Use that for more generic "*.foo" or "*.{foo,bar}" matching. Says Isaac: "it'd be cool :)".
https://github.com/isaacs/npm/blob/master/lib/utils/minimatch.js
Note: probably not using minimatch here. Just * ? [RANGE] and {CHOICES} support.
Not sure of real value of "**" support.
- edit support:
$ json -e foo=bar
{
Expand Down

0 comments on commit 08eb9fd

Please sign in to comment.