当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript execa类代码示例

本文整理汇总了TypeScript中execa的典型用法代码示例。如果您正苦于以下问题:TypeScript execa类的具体用法?TypeScript execa怎么用?TypeScript execa使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了execa类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: async

async () => {
    const { stdout } = await execa('stdin', {
        input: 'hello',
        stdio: [null, 'ignore', null]
    });
    assert(stdout === null);
};
开发者ID:DanCorder,项目名称:DefinitelyTyped,代码行数:7,代码来源:execa-tests.ts

示例2: async

const getSsim = async ({ toolName, imageName }: ISubject) => {
  const original = getPath({ toolName: 'photoshop', imageName });
  const optimised = getPath({ toolName, imageName });
  const { stdout } = await execa('pyssim', [original, optimised]);
  const ssim = parseFloat(stdout);
  return ssim;
};
开发者ID:JamieMason,项目名称:image-optimisation-tools-comparison,代码行数:7,代码来源:update-results.ts

示例3: log

 .then(exists => {
   log('found %s ?', exePath, exists)
   if (!exists) {
     throw notInstalledErr(`Browser ${name} file not found at ${exePath}`)
   }
   // on Windows using "--version" seems to always start the full
   // browser, no matter what one does.
   const args: [string] = [
     'datafile',
     'where',
     `name="${doubleEscape(exePath)}"`,
     'get',
     'Version',
     '/value'
   ]
   return execa('wmic', args)
     .then(result => result.stdout)
     .then(trim)
     .then(tap(log))
     .then(getVersion)
     .then((version: string) => {
       log("browser %s at '%s' version %s", name, exePath, version)
       return {
         name,
         version,
         path: exePath
       }
     })
 })
开发者ID:lgandecki,项目名称:cypress,代码行数:29,代码来源:index.ts

示例4: cache

const getLatLon = cache('latlon', async () => {
  debug('fetching lat/lon...')
  const { stdout } = await execa('whereami')
  let lines = stdout.split('\n')
  let lat = (lines.find(l => l.startsWith('Latitude:')) as string).split(': ')[1]
  let lon = (lines.find(l => l.startsWith('Longitude:')) as string).split(': ')[1]
  return { lat, lon }
})
开发者ID:dickeyxxx,项目名称:tmux-weather,代码行数:8,代码来源:tmux-weather.ts

示例5: _spawn

// eslint-disable-next-line no-underscore-dangle
function _spawn(command, args, opts) {
	children += 1;

	const child = execa(command, args, opts);
	const drain = (code, signal) => {
		children -= 1;

		// don't run repeatedly if this is the error event
		if (signal === undefined) {
			child.removeListener('exit', drain);
		}
	};

	child.once('exit', drain);
	child.once('error', drain);

	return child;
}
开发者ID:sutarmin,项目名称:dx-platform,代码行数:19,代码来源:child-process.utils.ts

示例6: getVersionString

export function getVersionString(path: string) {
  const doubleEscape = (s: string) => s.replace(/\\/g, '\\\\')

  // on Windows using "--version" seems to always start the full
  // browser, no matter what one does.

  const args = [
    'datafile',
    'where',
    `name="${doubleEscape(path)}"`,
    'get',
    'Version',
    '/value'
  ]

  return execa('wmic', args)
    .then(result => result.stdout)
    .then(trim)
}
开发者ID:YOU54F,项目名称:cypress,代码行数:19,代码来源:index.ts

示例7: tsc

async function tsc(out, cwd, optModule, optTarget) {
  await fs.remove(out);
  return exec(
    'tsc',
    ['--module', optModule, '--outDir', out, '--target', optTarget],
    { cwd }
  )
    .catch(e => e)
    .then(r => r.stdout);
}
开发者ID:skatejs,项目名称:skatejs,代码行数:10,代码来源:build.ts


注:本文中的execa类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。