JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 51883
  • Score
    100M100P100Q142967F
  • License MIT

The minimum and most straightforward way to check if command exists and where the executable is.

Package Exports

  • lookpath

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lookpath) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

lookpath

npm version npm download Node.js CI codecov Maintainability

To check if the command exists and where the executable file is.

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

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

Install

npm install lookpath

Background

Options

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

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

Issues

Any feedback would be appreciated ;)