codegear / json-formatter
Command-line tool to pretty-print JSON string for human readability
Installs: 83
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 1
Type:tool
pkg:composer/codegear/json-formatter
Requires
- php: >=7.0.0
This package is auto-updated.
Last update: 2025-09-29 02:21:34 UTC
README
Command-line tool to pretty-print JSON string for human readability by PHP.
https://whitephp.net/2018/07/31/jf-cli-json-formatter.html
Requirements
PHP needs to be a minimum version of PHP 7.0.0.
Installation
Globally by using Composer:
$ composer global require codegear/json-formatter
Usage
In Command-Line
Format file data.json
and output to screen:
$ jf data.json
Format file data.json
and save to another file data_formatted.json
:
$ jf data.json > data_formatted.json
In VIM
Format current file:
:%!jf %
or add a keymap in vimrc
:
nnoremap <Leader>jf :%!jf %<CR>