Reputation: 23
this is my code :
const CrawlE = require('crawl-e/v0.5.2')
const debug = require('debug')
let crawlE = new CrawlE({
cinemas: [
{
name: 'Kino Gmunden',
address: 'Theatergasse 7, 4810 Gmunden',
website: 'http://www.kino-gmunden.at/',
phone: '0676 / 88 794 505'
}
],
showtimes: {
url: 'https://www.daskino.at/programm/',
}
})
crawlE.crawl()
i want to add an environment variable Debug=*, how can i set it and make this script run with it ?
Upvotes: 2
Views: 1994
Reputation: 8101
If you are running your script from the command line just set the environment variable before running the script
// command line
DEBUG=* node index.js
// package.json
"scripts": {
"test": "DEBUG=* node index.js"
},
// example vscode launch configuration
{
"type": "node",
"request": "launch",
"env": { "DEBUG": "*" }, // -> this is the important part!
"name": "Main",
"program": "${workspaceFolder}/src/index.js",
"skipFiles": [
"${workspaceFolder}/node_modules/**/*.js",
"<node_internals>/**/*.js"
]
},
Upvotes: 2