Skip to content

8.1.3

Latest
Compare
Choose a tag to compare
@antonmedv antonmedv released this 19 Jun 20:53
· 3 commits to main since this release
a3b7316

Nothing special today. We just keep improving the implementation.

Features

  • ESM support is now available for Node.js v12 (previously was cjs only):

    #824, #827, #828
import {$} from 'zx'
  • zx/cli exports its inners to allow more advanced usage.
    Imagine, your own CLI tool that uses zx as a base:

    #828
#!/usr/bin/env node

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

main()
  • Provide intermediate store configuration for fine-grained control of memory usage.

    #650, #849
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()    // ''
  • Introduced sync methods for ps:

    #840
import { ps } from 'zx'

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

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

Chore

  • $.log accepts kind: 'custom' #834
  • Describe $.verbose and $.quiet modes internals #835
  • Mention quotePowerShell in docs #851
  • Finally fixed the annoying flaky problem of the process end detection in Bun #839, coderef
  • Suppress async_hooks.createHook warning on bun #848
  • Remove node-abort-controller in favor of built-in node-fetch polyfill #842
  • Add missing global types #853