json-helper101
v1.0.1
Published
A simple utility for checking and formatting JSON data.
Downloads
18
Readme
json-helper101
json-helper101
is a simple command-line utility for checking and formatting JSON data. It is useful for developers who need to validate and beautify JSON files, making it easier to work with JSON in development environments.
Features
- Validate JSON: Ensures that the provided file contains valid JSON.
- Format JSON: Formats the JSON with indentation to make it more readable.
- Simple CLI Usage: Easily validate and format JSON files from the command line.
Installation
To install the package globally using npm, run:
npm install -g json-helper101
Usage
You can use json-helper101
to validate and format a JSON file by running the following command:
json-helper101 path/to/your/file.json
Examples
Valid JSON File
If the file contains valid JSON, you will see the following output:
json-helper101 example.json
Output:
Valid JSON format! Formatted JSON: { "name": "John Doe", "age": 30, "city": "New York" }
Invalid JSON File
If the file contains invalid JSON, you will see an error message:
json-helper101 invalid.json
Output:
Invalid JSON format.
Notes
- Ensure that the path to the JSON file is correct when running the command.
- This tool is great for quickly validating JSON files before using them in your projects.
Contributing
If you find any issues or want to improve this tool, feel free to contribute! Open an issue or submit a pull request on GitHub.
License
This project is licensed under the ISC License.