1.1.1 • Published 1 month ago

pretty-json-file-formatter v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

pretty-json-file-formatter

A Node.js library for formatting JSON files in a pretty and human-readable way.

Installation

You can install the library via npm:

npm install pretty-json-file-formatter

Usage

const formatJsonFile = require('pretty-json-file-formatter');

// Format a JSON file
formatJsonFile('/path/to/your/file.json')
  .then(() => {
    console.log('JSON file formatted successfully.');
  })
  .catch((err) => {
    console.error('An error occurred:', err);
  });

API

formatJsonFile(filePath)

Formats the JSON data in the specified file and writes the formatted data back to the same file.

  • filePath (string): The path to the JSON file.

Returns a Promise that resolves when formatting is done.

License

This project is licensed under the MIT License - see the LICENSE file for details.

1.1.1

1 month ago

1.1.0

2 months ago

1.0.0

2 months ago