I have the following package.json file:
{
"main": "./dist/index.js",
"scripts": {
"build": "tsc",
"build:live": "tsc && node ./dist/index.js"
},
...
}
How can I get the value of the main field, then put it into the command node ./dist/index.js, something like this (just a example, I know this $ is for ENV variables):
{
"main": "./dist/index.js",
"scripts": {
"build": "tsc",
"build:live": "tsc && node $main"
},
...
}
Thanks in advance