I'm trying to add some custom scripts to package.json and I want to pass filepaths as parameters to the scripts for example i have this script
"captures": "node ./interfaceVisualTesting/captures.js",
which requires json files:
const repjsonref = require('../json/report1.json');
I want my script to be like this
"captures": "node ./interfaceVisualTesting/captures.js ../json/report1.json
and to require the parameter in the javascript file how can i do that ?
EDIT
I realized that i didn't ask the right question what i meant is i want the path to be passed as a parameter while writing the script like this
`npm node-script captures <path of json>`