MyGit

8.1.3

google/zx

版本发布时间: 2024-06-20 04:53:57

google/zx最新发布版本:8.1.4(2024-07-04 18:44:34)

Nothing special today. We just keep improving the implementation.

Features

import {$} from 'zx'
#!/usr/bin/env node

import './index.mjs'
import {main} from 'zx/cli'

main()
const getFixedSizeArray = (size) => {
  const arr = []
  return new Proxy(arr, {
    get: (target, prop) =>
      prop === 'push' && arr.length >= size
        ? () => {}
        : target[prop],
  })
}
const store = {
  stdout: getFixedSizeArray(1),
  stderr: getFixedSizeArray(1),
  stdall: getFixedSizeArray(0),
}

const p = await $({ store })`echo foo`

p.stdout.trim() //  'foo'
p.toString()    // ''
import { ps } from 'zx'

const list1 = await ps()
const list2 = await tree()

// new methods
const list3 = ps.sync()
const list4 = tree.sync()

Chore

相关地址:原始地址 下载(tar) 下载(zip)

查看:2024-06-20发行的版本