lookpath
The minimum and most straightforward way to check if command exists and where the executable is.
Last updated 4 years ago by otiai10 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install lookpath 
SYNC missed versions from official npm registry.

lookpath

npm version npm download Node.js CI codecov Maintainability FOSSA Status

To check if the command exists and where the executable file is, WITHOUT using child_process.

npm install lookpath

Example usage

const { lookpath } = require('lookpath');

const p = await lookpath('bash');
// "/bin/bash", otherwise "undefined"

Advanced usage

const p = await lookpath('bash', {
  include: ['/home/hiromu/.bin'],
  exclude: ['/mnt']
});
// include: Do scan also under `~/.bin`
// exclude: Do NOT scan under `/mnt`

Motivation

Issues

Any feedback would be appreciated ;)

License

FOSSA Status

Current Tags

  • 1.2.2                                ...           latest (3 years ago)

16 Versions

  • 1.2.2                                ...           3 years ago
  • 1.2.1                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.6                                ...           5 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 10
Last Day 0
Last Week 10
Last Month 0
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |