How to use the get-bin-path.getBinPath function in get-bin-path

To help you get started, we’ve selected a few get-bin-path 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 ehmicky / nve / test / helpers / run.js View on Github external
import execa from 'execa'
import { getBinPath } from 'get-bin-path'
import { nodejs } from 'figures'

const BIN_PATH = getBinPath()

// eslint-disable-next-line max-params
export const runSerial = function(opts, versionRange, args, execaOpts) {
  return runCli(opts, `${versionRange} ${versionRange}`, args, execaOpts)
}

// eslint-disable-next-line max-params
export const runParallel = function(opts, versionRange, args, execaOpts) {
  return runCli(
    `${opts} --parallel`,
    `${versionRange} ${versionRange}`,
    args,
    execaOpts,
  )
}
github ehmicky / unix-permissions / test / helpers / cli.js View on Github external
import execa from 'execa'
import { getBinPath } from 'get-bin-path'

const BINARY_PATH = getBinPath()

// Call CLI command `unix-permissions COMMAND ...ARGS` and return output
export const callCli = async function(command, ...args) {
  const argsA = args.map(stringifyCliArg)

  const { stdout, stderr, exitCode } = await execa(
    await BINARY_PATH,
    [command, ...argsA],
    { reject: false },
  )

  const stderrA = stderr.replace(HELP_MESSAGE_REGEXP, 'Help message')

  return { exitCode, stdout, stderr: stderrA }
}
github ehmicky / autoserver / gulp / run.js View on Github external
import { promisify } from 'util'

import Nodemon from 'nodemon'
import { exec } from 'gulp-execa'
import { getBinPath } from 'get-bin-path'

const EXAMPLE_PATH = `${__dirname}/../examples/main.js`
const SRC_PATH = `${__dirname}/../build/src`
const BINARY_PATH = getBinPath()

// We use this instead of requiring the application to test the CLI
export const runProd = async () => {
  const binaryPath = await BINARY_PATH
  await exec(`node ${binaryPath}`, { cwd: 'examples' })
}

// eslint-disable-next-line fp/no-mutation
runProd.description = 'Run an example production server'

export const runDev = () => startNodemon(NODEMON_CONFIG)

// eslint-disable-next-line fp/no-mutation
runDev.description = 'Start an example dev server'

export const runDebug = () => startNodemon(DEBUG_NODEMON_CONFIG)

get-bin-path

Get the current package's binary path

Apache-2.0
Latest version published 9 months ago

Package Health Score

61 / 100
Full package analysis