Trending questions in Node-js

0 votes
1 answer

How do I uninstall a package installed using npm link?

Hello @kartik, The package can be uninstalled using ...READ MORE

Jul 16, 2020 in Node-js by Niroj
• 82,880 points
3,779 views
0 votes
1 answer

How to execute an external program from within Node.js?

Hello @kartik, Exec has memory limitation of buffer ...READ MORE

Jul 17, 2020 in Node-js by Niroj
• 82,880 points
3,716 views
0 votes
1 answer

How to redirect 404 errors to a page in ExpressJS?

Hello @kartik, You can put a middleware at ...READ MORE

Jul 16, 2020 in Node-js by Niroj
• 82,880 points
3,656 views
0 votes
1 answer

How to list npm user-installed packages?

Hello @kartik, This works pretty well too:  npm list ...READ MORE

Jul 9, 2020 in Node-js by Niroj
• 82,880 points
3,937 views
0 votes
1 answer

How do I determine the current operating system with Node.js

Hello @kartik, With Node.js v6 (and above) there ...READ MORE

Jul 14, 2020 in Node-js by Niroj
• 82,880 points
3,432 views
0 votes
1 answer

How to programmatically send a 404 response with Express/Node?

Hello @kartik, The method is: res.sendStatus(404); Express will send a ...READ MORE

Jul 16, 2020 in Node-js by Niroj
• 82,880 points
3,232 views
0 votes
1 answer

How do I get the time of day in javascript/Node.js?

Hello @kartik, This function will return you the ...READ MORE

Sep 7, 2020 in Node-js by Niroj
• 82,880 points
851 views
0 votes
1 answer

How nodejs get file name from absolute path?

Hello @kartik, Use the basename method of the path module: path.basename('/foo/bar/baz/asdf/quux.html') // returns 'quux.html' If you ...READ MORE

Jul 14, 2020 in Node-js by Niroj
• 82,880 points
3,063 views
0 votes
1 answer

Error: CERT_UNTRUSTED while using npm command

Hello @kartik, You can bypass https using below ...READ MORE

Jul 17, 2020 in Node-js by Niroj
• 82,880 points
2,876 views
0 votes
1 answer

How do I “include” functions from my other files in nodejs?

Hello @kartik, You require any js file,so you just ...READ MORE

Jul 9, 2020 in Node-js by Niroj
• 82,880 points
3,025 views
0 votes
1 answer

How to print a stack trace in Node.js?

Hello @kartik, Any Error object has a stack member that traps the ...READ MORE

Jul 20, 2020 in Node-js by Niroj
• 82,880 points
2,510 views
0 votes
1 answer

How to get GET (query string) variables in Express.js on Node.js?

Hello @kartik, Since you've mentioned Express.js in your ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
3,007 views
–1 vote
1 answer

How to uninstall npm modules in node js?

Hello @kartik, The command is simply: npm uninstall ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
2,830 views
0 votes
1 answer

How to install a previous exact version of a NPM package?

Hello @kartik, If you have to install an ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
2,575 views
0 votes
1 answer

How do you reinstall an app's dependencies using npm?

Hello @kartik, The easiest way is  to delete node_modules folder ...READ MORE

Jul 12, 2020 in Node-js by Niroj
• 82,880 points
2,312 views
0 votes
1 answer

How do I get the path to the current script with Node.js?

Hello @kartik, you can do this: fs.readFile(path.resolve(__dirname, 'settings.json'), 'UTF-8', ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
2,469 views
0 votes
1 answer

How do I URl encode something in Node.js?

Hello @kartik, The built-in module querystring is what you're looking ...READ MORE

Jul 14, 2020 in Node-js by Niroj
• 82,880 points
2,149 views
0 votes
1 answer

How to process POST data in Node.js?

Hello @kartik, You can use the querystring module: var qs = ...READ MORE

Jul 9, 2020 in Node-js by Niroj
• 82,880 points
2,345 views
0 votes
1 answer

How can i get the extension of the image in node.js?

Hello @kar You can do the following to ...READ MORE

Jul 16, 2020 in Node-js by Niroj
• 82,880 points
1,803 views
0 votes
1 answer

How do I install the babel-polyfill library?

Hello @kartik, If your package.json looks something like ...READ MORE

Jul 17, 2020 in Node-js by Niroj
• 82,880 points
1,548 views
0 votes
1 answer

How to auto-reload files in Node.js?

Hello @kartik, A good, up to date alternative ...READ MORE

Jul 9, 2020 in Node-js by Niroj
• 82,880 points
1,864 views
0 votes
1 answer

How to make connection to Postgres via Node.js?

Hello @kartik, Here is an example I used ...READ MORE

Jul 17, 2020 in Node-js by Niroj
• 82,880 points
1,409 views
0 votes
1 answer

How to create an HTTPS server in Node.js?

Hello @kartik, The minimal setup for an HTTPS ...READ MORE

Jul 13, 2020 in Node-js by Niroj
• 82,880 points
1,527 views
0 votes
0 answers

How to install a private NPM module without my own registry?

I've taken some code and put it in ...READ MORE

Jul 13, 2020 in Node-js by kartik
• 37,510 points
1,374 views
0 votes
1 answer

How to use executables from a package installed locally in node_modules?

Hello @kartik, Use the npm bin command to get the ...READ MORE

Jul 13, 2020 in Node-js by Niroj
• 82,880 points
1,336 views
0 votes
1 answer

How to run Gulp tasks sequentially one after the other?

Hello @kartik, By default, gulp runs tasks simultaneously, ...READ MORE

Jul 12, 2020 in Node-js by Niroj
• 82,880 points
1,235 views
0 votes
1 answer

How to read environment variables in Node.js?

Hello @kartik, Yes,you can read environment variables in Node.js ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
1,384 views
0 votes
1 answer

How is an HTTP POST request made in node.js?

Hello @kartik, A easier way if you use ...READ MORE

Jul 20, 2020 in Node-js by Niroj
• 82,880 points
652 views
0 votes
1 answer

How to install a private NPM module without my own registry?

Hello @kartik, Try: cd somedir npm install . or npm install path/to/somedir somedir must ...READ MORE

Jul 20, 2020 in Node-js by Niroj
• 82,880 points
600 views
0 votes
1 answer

How to create a directory if it doesn't exist using Node.js?

Hello @kartik, Try this: var fs = require('fs'); var dir ...READ MORE

Jul 20, 2020 in Node-js by Niroj
• 82,880 points
557 views
0 votes
1 answer

How do you log content of a JSON object in Node.js?

Hello @kartik, Try this one: console.log("Session: %j", session); If the ...READ MORE

Jul 16, 2020 in Node-js by Niroj
• 82,880 points
704 views
0 votes
1 answer

How to append to a file in Node?

Hello @kartik, you can use appendFile, which creates a ...READ MORE

Jul 20, 2020 in Node-js by Niroj
• 82,880 points
504 views
0 votes
1 answer

How to parse JSON using Node.js?

Hello @kartik, You can simply use JSON.parse. The definition of ...READ MORE

Jul 20, 2020 in Node-js by Niroj
• 82,880 points
473 views
0 votes
1 answer

How to retrieve POST query parameters?

Hello @kartik, This will do it if you ...READ MORE

Jul 20, 2020 in Node-js by Niroj
• 82,880 points
459 views
0 votes
1 answer

How do I determine the current operating system with Node.js?

Hello @kartik, With Node.js v6 (and above) there ...READ MORE

Jul 20, 2020 in Node-js by Niroj
• 82,880 points
452 views
0 votes
1 answer

How to get the server's port?

Hello @kartik, I use this way Express 4: app.listen(1337, ...READ MORE

Jul 17, 2020 in Node-js by Niroj
• 82,880 points
601 views
0 votes
1 answer

How to show the latest version of a package?

Hello @kartik, You can use: npm show {pkg} version (so npm ...READ MORE

Jul 15, 2020 in Node-js by Niroj
• 82,880 points
592 views
0 votes
1 answer

How TO install a local module using npm?

Hello @kartik, In the local module directory: $ cd ...READ MORE

Jul 13, 2020 in Node-js by Niroj
• 82,880 points
674 views
0 votes
1 answer

Error:npm throws error without sudo

Hello @kartik, This looks like a permissions issue ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
889 views
0 votes
1 answer

How do I install a module globally using npm?

Hello @kartik, I found the output contained the ...READ MORE

Jul 16, 2020 in Node-js by Niroj
• 82,880 points
532 views
0 votes
1 answer

How to paginate with Mongoose in Node.js?

Hello @kartik, You can chain just like that: var ...READ MORE

Jul 15, 2020 in Node-js by Niroj
• 82,880 points
560 views
+2 votes
1 answer

How do I debug Node.js applications?

Hello @kartik, Use node-inspector  from any browser supporting WebSocket. Breakpoints, ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
776 views
0 votes
0 answers

How to append to a file in Node?

I am trying to append a string to a ...READ MORE

Jul 9, 2020 in Node-js by kartik
• 37,510 points
769 views
0 votes
1 answer

How to write files in Node.js?

Hello @kartik, Currently there are three ways to ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
704 views
0 votes
1 answer

How to print a stack trace in Node.js?

Hello @kartik, To print stacktrace of Error in console in ...READ MORE

Jul 9, 2020 in Node-js by Niroj
• 82,880 points
629 views
0 votes
1 answer

Node.js version on the command line?

Hello @kartik, The command line for that is: node ...READ MORE

Jul 13, 2020 in Node-js by Niroj
• 82,880 points
411 views
0 votes
1 answer

How do I update Node.js?

Hello @kartik, First update npm, npm install -g npm stable Then ...READ MORE

Jul 8, 2020 in Node-js by Niroj
• 82,880 points
560 views