Socket
Socket
Sign inDemoInstall

prettyjson

Package Overview
Dependencies
1
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.1 to 0.3.0

bin/prettyjson

5

History.md

@@ -0,1 +1,6 @@

### 0.3.0 — *January 24, 2012*
* Added CLI interface
* Now prettyjson package requires Nodejs 0.6.x
### 0.2.1 — *January 23, 2012*

@@ -2,0 +7,0 @@

7

package.json

@@ -5,3 +5,3 @@ {

"description": "Package for formatting JSON data in a coloured YAML-style, perfect for CLI output",
"version": "0.2.1",
"version": "0.3.0",
"homepage": "https://github.com/rafeca/prettyjson",

@@ -22,4 +22,7 @@ "keywords": [

},
"bin": {
"prettyjson": "./bin/prettyjson"
},
"engines": {
"node": ">= 0.4.1 < 0.7.0"
"node": ">= 0.6.0 < 0.7.0"
},

@@ -26,0 +29,0 @@ "dependencies": {

@@ -11,11 +11,30 @@ # prettyjson [![Build Status](https://secure.travis-ci.org/rafeca/prettyjson.png)](http://travis-ci.org/rafeca/prettyjson)

If you'd prefer to install the latest master version of `prettyjson`, you can clone the GitHub source repository
and then install it using `npm`:
## Using it (from the CLI)
This package installs a command line interface to render JSON data in a more convenient way. You can use the CLI
in three different ways:
**Decode a JSON file:** If you want to see the contents of a JSON file, just pass it as the first argument to the CLI:
$ git clone "https://github.com/rafeca/prettyjson.git"
$ prettyjson package.json
![Example 1](http://rafeca.com/prettyjson/images/example3.png)
**Decode the stdin:** You can also pipe the result of a command (for example an HTTP request) to the CLI to see
the JSON result in a clearer way:
$ npm install prettyjson/
$ curl https://api.github.com/users/rafeca | prettyjson
## How to use it
![Example 2](http://rafeca.com/prettyjson/images/example4.png)
**Decode random strings:** if you call the CLI with no arguments, you'll get a prompt where you can past JSON strings
and they'll be automatically displayed in a clearer way:
![Example 3](http://rafeca.com/prettyjson/images/example5.png)
If you install the package globally (with `npm install -g prettyjson`), the CLI will be installed automatically in your PATH
thanks to npm.
## Using it (from Node.js)
It's pretty easy to use it... you just have to include it in your script and call the `render()` method:

@@ -36,3 +55,3 @@

![Example 1](http://rafeca.com/prettyjson/images/example1.png)
![Example 4](http://rafeca.com/prettyjson/images/example1.png)

@@ -58,3 +77,3 @@ You can also configure the colors of the hash keys and array dashes

![Example 2](http://rafeca.com/prettyjson/images/example2.png)
![Example 5](http://rafeca.com/prettyjson/images/example2.png)

@@ -61,0 +80,0 @@ ## Annotated source

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc