UNPKG

@bincode/jekpack

Version:

[![npm version](https://badge.fury.io/js/%40bincode%2Fjekpack.svg)](https://badge.fury.io/js/%40bincode%2Fjekpack) [![Build Status](https://travis-ci.org/yfxie/jekpack.svg?branch=master)](https://travis-ci.org/yfxie/jekpack) [![codecov](https://codecov.io

16 lines (15 loc) 344 B
const commandExistsSync = require('command-exists').sync; const execa = require('execa'); module.exports = async(cmd) => { const [_cmd, ...args] = cmd.split(' '); if (args.length) { try { await execa(_cmd, args); return true; } catch (e) { return false; } } else { return commandExistsSync(_cmd); } };