How to use the executable function in executable

To help you get started, we’ve selected a few executable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arduino-cli / arduino-node / test / basics.js View on Github external
test('arduino should load and unload arduino latest', async t => {
  const arduinoObj = arduino({path: 'tmp', tag: 'load'});
  let err = await pify(arduinoObj.load)();
  t.is(err, undefined);
  const bin = await pify(arduinoObj.binary)();
  const exec = await executable(bin);
  t.is(exec, true);
  err = await pify(arduinoObj.unload)();
  t.is(err, undefined);
  const result = await exists(bin);
  t.is(result, false);
});
github decaffeinate / bulk-decaffeinate / src / util / FilePaths.js View on Github external
async function isExecutableScript(path, recognizer) {
  if (isExtensionless(path) && await executable(path)) {
    let contents = await readFile(path);
    let firstLine = contents.toString().split('\n')[0];
    if (firstLine.startsWith('#!') && firstLine.includes(recognizer.shebangSuffix)) {
      return true;
    }
  }
  return false;
}

executable

Check if a file is executable

MIT
Latest version published 6 years ago

Package Health Score

65 / 100
Full package analysis