compare-spec-up-t-specs
v1.0.4
Published
Compares local specs.json with a reference specs.json from GitHub
Readme
Compare Spec-Up-T-Specs
A command-line tool that compares your local specs.json file with a reference specs.json file from the spec-up-t GitHub repository.
Overview
This tool helps you identify differences between your local specs.json configuration and the reference configuration. It's particularly useful for:
- Ensuring your specs configuration adheres to the reference standard
- Identifying custom configurations you've added
- Finding missing required configurations
Installation
You can install this tool globally:
npm install -g compare-spec-up-t-specsOr locally in your project:
npm install compare-spec-up-t-specs --save-devUsage
Global Installation
If you've installed the tool globally, you can run it from any directory containing a specs.json file:
compare-spec-up-t-specsLocal Installation
If you've installed it locally, you can run it using npx:
npx compare-spec-up-t-specsDirect Usage with npx (No Installation)
You can run the tool directly without installing it by using npx:
npx compare-spec-up-t-specsThis will download and execute the package in a single command, which is convenient for one-time use or when you want to try the package without installing it.
As a Script in package.json
Add it to your package.json scripts:
"scripts": {
"compare-specs": "compare-spec-up-t-specs"
}Then run:
npm run compare-specsHow It Works
The tool fetches the reference
specs.jsonfile from:https://raw.githubusercontent.com/blockchainbird/spec-up-t/master/src/install-from-boilerplate/boilerplate/specs.jsonIt reads your local
specs.jsonfile from the current directoryBoth JSON objects are normalized by sorting their keys to ensure the comparison focuses on content differences rather than key ordering
The tool displays a diff between the two files with:
- Red (-) lines: Parts present in the reference file but missing in your local file
- Green (+) lines: Parts present in your local file but missing in the reference file
Notes
- JSON objects are unordered, so the order of keys does not affect the comparison
- If your JSON contains arrays, differences in array order will be shown as those are ordered collections
- Keys that appear in green are not present in the reference file, which means they are not part of the standard spec
Dependencies
License
MIT
