Tuesday, 1 September 2020

Could really us some help with node. Basic stuff

Node ain't my main thing. Struggling to wrap my head around several things.I should go through a proper course, but I have to ship a script today, which 'works', but is a damn spaghetti nightmare just to look at. I don't know too much of node. Would appreciate one line answersconst,let,var : const is just contstant , I guess. var is function scope ? let is block ?const {GoogleAuth} - What do the brackets do ?Is this a bad idea: var GlobalSheetVals = { rowNumber: 0 } , at the top of the page?non-node way -$ret = searchMeta();if ($ret > 10) {dostuff}else{logError}How can this be achieved in node ? I guess one way is to to make it synchronous , using await/async? The other ? promises ? I tried understanding async/await/promises - but that would need more study.organize constants into one place ? I got thisvar fs = require("fs");const puppeteer = require('puppeteer');Now to put into a separate file. Use exports module. Exactly how please? The methods I saw seem to change the variable name. fs will be accessed by variable.fs , after a require.Thanks a lot!

Submitted September 01, 2020 at 03:38PM by gyaani_guy

No comments:

Post a Comment