You could use exec
to call the system ping command
var exec = require('child_process').exec;
exec("ping -c 3 localhost", function (err, stdout, stderr) {
console.log(stdout);
});
More Related Contents:
- How would I create a for-loop in Node.js
- How can I update NodeJS and NPM to their latest versions?
- ERR_HTTP_HEADERS_SENT: Cannot set headers after they are sent to the client
- Error handling with node.js streams
- How to separate routes on Node.js and Express 4?
- How to Polyfill node core modules in webpack 5
- What is the difference between –save and –save-dev?
- How to remove module after “require” in node.js?
- Extending TypeScript Global object in node.js
- Do I need dependency injection in NodeJS, or how to deal with …?
- Username and Password not accepted when using nodemailer?
- Upgrading Node on an Azure website?
- npm ERR! network getaddrinfo ENOTFOUND
- Express doesn’t set a cookie
- How to server specifc static files with express.js
- How do I get a list of connected sockets/clients with Socket.IO?
- npm: When to use `–force` and `–legacy-peer-deps`
- Loop through an api get request with variable URL
- Node Version Manager install – nvm command not found
- How do I handle exceptions globally with native promises in node.js?
- Cannot find runtime ‘node’ on PATH – Visual Studio Code and Node.js
- How to npm install global not as root?
- How to mount express.js sub-apps?
- Can node.js code result in race conditions?
- Axios (in React-native) not calling server in localhost
- Angularjs $http does not seem to understand “Set-Cookie” in the response
- Node.js + MongoDB: insert one and return the newly inserted document
- One project with multiple package.json files
- Mongoose findOneAndUpdate and runValidators not working
- mongoose recursive populate