UNPKG

json-parser-yaml-converter

Version:
25 lines (20 loc) 721 B
#!/usr/bin/env node /** * This module contains the executable checkJson that checks if a JSON file is valid. * * @module checkJson */ 'use strict'; import { program } from 'commander'; import { createRequire } from 'module'; const require = createRequire(import.meta.url); const { version } = require('../package.json'); import { jsonLogger } from '../src/loggers.js'; program .name('checkjson') .description('Checks if a JSON file is valid and if not it returns the error') .version(version, '-v, --version', 'Output the version number') .helpOption('-h, --help', 'Display help') .argument('<jsonFile>', 'JSON file to check') .action(jsonLogger); program.parse(process.argv);