0.0.6-1 • Published 5 years ago

linux-command-exists v0.0.6-1

Weekly downloads
3
License
GPL-3.0
Repository
github
Last release
5 years ago

linux-command-exists

Check if a command exists

Examples

var commandExists = require("linux-command-exists").commandExists;

//With Promise
commandExists("ls")
  .then(exists => {
    if (exists === true) {
      console.log("The command ls exists");
    } else {
      console.log('The command "ls" doesn\'t exists');
    }
  })
  .catch(e => {
    console.error(`An error happened:\n${e.message}`);
  });

//With Callback
commandExists("ls", (error, exists) => {
  if (error) {
    console.error(`An error happened:\n${e.message}`);
  } else {
    if (exists === true) {
      console.log('The command "ls" exists');
    } else {
      console.log('The command "ls" doesn\'t exists');
    }
  }
});
0.0.6-1

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago