Khả Hân
-
Hỏi đáp
What is the purpose of Node.js module.exports and how do you use it?
What is the purpose of Node.js module.exports and how do you use it? I can’t seem to find any information…
Đọc thêm » -
Hỏi đáp
Read environment variables in Node.js
Is there a way to read environment variables in Node.js code? Like for example Python’s os.environ['HOME']. Answers: process.env.ENV_VARIABLE Where ENV_VARIABLE…
Đọc thêm » -
Hỏi đáp
How to get GET (query string) variables in Express.js on Node.js?
Can we get the variables in the query string in Node.js just like we get them in $_GET in PHP?…
Đọc thêm » -
Hỏi đáp
How do you get a list of the names of all files present in a directory in Node.js?
I’m trying to get a list of the names of all the files present in a directory using Node.js. I…
Đọc thêm » -
Hỏi đáp
How do I debug Node.js applications?
How do I debug a Node.js server application? Right now I’m mostly using alert debugging with print statements like this:…
Đọc thêm » -
Hỏi đáp
How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
My version of node is always v0.6.1-pre even after I install brew node and NVM install v0.6.19. My node version…
Đọc thêm » -
Hỏi đáp
How can the default node version be set using NVM?
I have installed nvm (ubuntu with zsh shell) with two node version: v6.11.5 and v9.0.0 and the default version in…
Đọc thêm » -
Hỏi đáp
map function for objects (instead of arrays)
I have an object: myObject = { 'a': 1, 'b': 2, 'c': 3 } I am looking for a native…
Đọc thêm » -
Hỏi đáp
Writing to files in Node.js
I’ve been trying to find a way to write to a file when using Node.js, but with no success. How…
Đọc thêm » -
Hỏi đáp
How to decide when to use Node.js?
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not…
Đọc thêm » -
Hỏi đáp
How can I update Node.js and npm to their latest versions?
I just installed Node.js and npm. I installed npm for access to additional Node.js modules. After I installed Node.js and…
Đọc thêm » -
Hỏi đáp
How to exit in Node.js
What is the command that is used to exit? (i.e terminate the Node.js process) Answers: Call the global process object’s…
Đọc thêm » -
Hỏi đáp
Do I commit the package-lock.json file created by npm 5?
npm 5 was released today and one of the new features include deterministic installs with the creation of a package-lock.json…
Đọc thêm » -
Hỏi đáp
Error message “error:0308010C:digital envelope routines::unsupported”
I created the default IntelliJ IDEA React project and got this: Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at…
Đọc thêm » -
Hỏi đáp
How can I update each dependency in package.json to the latest version?
I copied package.json from another project and now want to bump all of the dependencies to their latest versions since…
Đọc thêm »