Skip to content

Tag: node.js

Run node module in browser

I’m trying to upload and read excel file using this node module: read-excel-file and according to the instructions under Browser I need to put this code in my .js file: But the browser doesn’t know what is import readXlsxFile from ‘read-excel-file’. It should be noted that I’m us…

.env vs config.json

I just started learning JavaScript / node.js (a gentle introduction to back-end webdev), and thus I am completely green in the subject. A few days ago I was reading a tutorial from which I learned to keep my confidential data (like passwords) in a config.json file. Today I have discovered (by a chance) .env f…

NestJs async httpService call

How can I use Async/Await on HttpService using NestJs? The below code doesn`t works: Answer The HttpModule uses Observable not Promise which doesn’t work with async/await. All HttpService methods return Observable<AxiosResponse<T>>. So you can either transform it to a Promise and then use aw…