Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nicksieger/jsonpretty
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.0
Choose a base ref
...
head repository: nicksieger/jsonpretty
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 31, 2021

  1. Copy the full SHA
    e64d8a1 View commit details
  2. Copy the full SHA
    416798b View commit details
  3. More README formatting

    nicksieger committed Dec 31, 2021
    Copy the full SHA
    6d1dbf4 View commit details
Showing with 29 additions and 14 deletions.
  1. +27 −12 README.md
  2. +2 −2 jsonpretty.gemspec
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -4,18 +4,15 @@

## DESCRIPTION

Command-line JSON pretty-printer, using the json gem.
Command-line JSON pretty-printer. Pipe any JSON output to pretty-print it with 2-space indent.

## FEATURES/PROBLEMS
## FEATURES

- Parse and pretty-print JSON/JSONP either from stdin or from command-line
arguments.
- All arguments are concatenated together in a single string for
pretty-printing.
- Use '@filename' as an argument to include the contents of the file.
- Use '-' or '@-' as an argument (or use no arguments) to read stdin.
- Detects HTTP response/headers, prints them untouched, and skips to
the body (for use with `curl -i').
- Parse and pretty-print JSON/JSONP either from stdin or from command-line arguments.
- All arguments are concatenated together in a single string for pretty-printing.
- Use `@filename` as an argument to include the contents of the file.
- Use `-` or `@-` as an argument (or use no arguments) to read stdin.
- Detects HTTP response/headers, prints them untouched, and skips to the body (for use with `curl -i').

## SYNOPSIS

@@ -25,21 +22,39 @@ curl -i http://api.com/json | jsonpretty

## REQUIREMENTS

json or json_pure
- For the Ruby version: any Ruby version >= 2 installed
- For the Go version: none for the release binary, or Go 1.17 for `go install`

## INSTALL

Install the Ruby version with rubygems:

```
gem install jsonpretty
```

or install globally with brew-gem:
Install the Ruby version globally with Homebrew and brew-gem:

```
brew install brew-gem
brew gem install jsonpretty
```

Install the Go version with `go install` (requires Go 1.17):

```
go install github.com/nicksieger/jsonpretty
```

Or install the Go version from a release with curl+tar:

```
VERSION=1.2.0
OS=$(uname -s)
ARCH=$(uname -m)
curl -L https://github.com/nicksieger/jsonpretty/releases/download/v${VERSION}/jsonpretty_${VERSION}_${OS}_${ARCH}.tar.gz | sudo tar -C /usr/local/bin -zxf - jsonpretty
```

## LICENSE

See [LICENSE](LICENSE.txt).
4 changes: 2 additions & 2 deletions jsonpretty.gemspec
Original file line number Diff line number Diff line change
@@ -23,6 +23,6 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_development_dependency "bundler", "~> 1.17"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "bundler", ">= 2.2.33"
spec.add_development_dependency "rake", ">= 12.3.3"
end