node.js
-
Hỏi đáp
In Node.js, how do I “include” functions from my other files?
Let’s say I have a file called app.js. Pretty simple: var express = require('express'); var app = express.createServer(); app.set('views', __dirname…
Đọc thêm » -
Hỏi đáp
Error: Can’t set headers after they are sent to the client
I’m fairly new to Node.js and I am having some issues. I am using Node.js 4.10 and Express 2.4.3. When…
Đọc thêm » -
Hỏi đáp
How do I get started with Node.js [closed]
Closed. This question is seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. It does not meet…
Đọc thêm » -
Hỏi đáp
How can I do Base64 encoding in Node.js?
Does Node.js have built-in Base64 encoding yet? The reason why I ask this is that final() from crypto can only…
Đọc thêm » -
Hỏi đáp
How to install a previous exact version of a NPM package?
I used nvm to download node v0.4.10 and installed npm to work with that version of node. I am trying…
Đọc thêm » -
Hỏi đáp
Using Node.js as a simple web server
I want to run a very simple HTTP server. Every GET request to example.com should get index.html served to it…
Đọc thêm » -
Hỏi đáp
Using Node.js require vs. ES6 import/export
In a project I am collaborating on, we have two choices on which module system we can use: Importing modules…
Đọc thêm » -
Hỏi đáp
How do I get the path to the current script with Node.js?
How would I get the path to the script in Node.js? I know there’s process.cwd, but that only refers to…
Đọc thêm » -
Hỏi đáp
How can I uninstall npm modules in Node.js?
As commonly known, any npm module can be installed by running a simple command: npm install <module_name>. I have installed…
Đọc thêm » -
Hỏi đáp
Sending command line arguments to npm script
The scripts portion of my package.json currently looks like this: "scripts": { "start": "node ./script.js server" } …which means I…
Đọc thêm » -
Hỏi đáp
Check synchronously if file/directory exists in Node.js
How can I synchronously check, using node.js, if a file or directory exists? Answers: The answer to this question has…
Đọc thêm » -
Hỏi đáp
Where does npm install packages?
Can someone tell me where can I find the Node.js modules, which I installed using npm? Answers: Global libraries You…
Đọc thêm » -
Hỏi đáp
How can I get the full object in Node.js’s console.log(), rather than ‘[Object]’?
I have this object: const myObject = { "a":"a", "b":{ "c":"c", "d":{ "e":"e", "f":{ "g":"g", "h":{ "i":"i" } } }…
Đọc thêm » -
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 »