Package Exports
- diffx-js
- diffx-js/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (diffx-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
diffx-js
A Node.js wrapper for the diffx CLI tool.
Installation
npm install diffx-jsThis will automatically download the appropriate diffx binary for your system from GitHub Releases.
Usage
const { runDiffx } = require('diffx-js');
async function main() {
// Compare two JSON files
let result = await runDiffx(["file1.json", "file2.json"]);
if (result.code === 0) {
console.log("No differences found.");
} else {
console.log("Differences found:");
console.log(result.stdout);
}
// You can pass any arguments supported by the diffx CLI
result = await runDiffx(["file1.yaml", "file2.yaml", "--output", "json"]);
console.log(result.stdout);
}
main();Development
To link for local development:
npm linkLicense
This project is licensed under the MIT License.