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,799 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,726 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,663 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,945 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,452 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,244 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
859 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,075 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,884 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,035 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,516 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,019 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,838 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,586 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,319 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,470 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,157 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,351 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,809 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,553 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,878 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,417 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,540 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,380 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,344 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,243 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,390 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
657 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
606 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
561 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
711 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
511 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
475 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
461 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
460 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
610 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
603 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
682 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
896 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
544 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
567 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
780 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
770 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
710 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
643 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
416 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
574 views