node.js - Get the value of another field in package.json file (npm) -


i have following package.json file:

{   "main": "./dist/index.js",   "scripts": {     "build": "tsc",     "build:live": "tsc && node ./dist/index.js"   },   ... } 

how can value of main field, put command node ./dist/index.js, (just example, know $ env variables):

{   "main": "./dist/index.js",   "scripts": {     "build": "tsc",     "build:live": "tsc && node $main"   },   ... } 

thanks in advance


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -