Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soheilpro/catj
Displays JSON files in a flat format.
https://github.com/soheilpro/catj
cat cli json
Last synced: 17 days ago
JSON representation
Displays JSON files in a flat format.
- Host: GitHub
- URL: https://github.com/soheilpro/catj
- Owner: soheilpro
- License: mit
- Created: 2014-12-09T22:21:31.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-11-14T18:33:44.000Z (almost 4 years ago)
- Last Synced: 2024-09-24T18:47:35.904Z (about 2 months ago)
- Topics: cat, cli, json
- Homepage:
- Size: 10.7 KB
- Stars: 1,325
- Watchers: 9
- Forks: 21
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - catj - Displays JSON files in a flat format. (Others)
README
# catj
Displays JSON files in a flat format.Input:
``` json
{
"mappings": {
"templates": [
{
"fields": {
"mapping": {
"norms": false,
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
}
}
}
]
}
}
```Output:
``` bash
.mappings.templates[0].fields.mapping.norms = false
.mappings.templates[0].fields.mapping.type = "text"
.mappings.templates[0].fields.mapping.fields.keyword.ignore_above = 256
.mappings.templates[0].fields.mapping.fields.keyword.type = "keyword"
```## Why?
- It makes it easier to understand the structure of JSON files.
- The output is valid JavaScript which can be used directly in code.
- It's very helpful when writing queries for tools like [jq](https://stedolan.github.io/jq/manual/).## Install
``` bash
npm install -g catj
```## Usage
``` bash
catj [file]
```If no file is specified, catj reads from the standard input.
## Version History
+ **1.0**
+ Initial release.## Author
**Soheil Rashidi**+ http://soheilrashidi.com
+ http://twitter.com/soheilpro
+ http://github.com/soheilpro## Copyright and License
Copyright 2014 Soheil RashidiLicensed under the The MIT License (the "License");
you may not use this work except in compliance with the License.
You may obtain a copy of the License in the LICENSE file, or at:http://www.opensource.org/licenses/mit-license.php
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.