zx

A tool for writing better scripts

APACHE-2.0 License

Downloads
2.9M
Stars
42K
Committers
44

Bot releases are visible (Hide)

zx -

Published by antonmedv over 2 years ago

In this release:

  • Fully rewritten in TypeScript.
  • Code coverage is now 99%.
  • New within() API for async contexts.
  • echo() now comes out of the box.
  • Support for --eval flag.
  • REPL support.
zx - 6.2.5

Published by antonmedv over 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/google/zx/compare/6.2.4...6.2.5

zx - 6.2.4

Published by antonmedv over 2 years ago

What's Changed

Full Changelog: https://github.com/google/zx/compare/6.2.3...6.2.4

zx - 6.2.3

Published by antonmedv over 2 years ago

What's Changed

Full Changelog: https://github.com/google/zx/compare/6.2.2...6.2.3

zx - 6.2.2

Published by antonmedv over 2 years ago

What's Changed

Full Changelog: https://github.com/google/zx/compare/6.2.1...6.2.2

zx -

Published by antonmedv over 2 years ago

  • Fixed $.verbose type.
zx -

Published by antonmedv over 2 years ago

This release adds async local contexts via ctx() and configurable logger.

zx - 6.1.0

Published by antonmedv over 2 years ago

This release contains updates of dependencies:

 minimist   ^1.2.5  →  ^1.2.6
 yaml      ^1.10.2  →  ^2.0.0
zx - 6.0.7

Published by antonmedv over 2 years ago

What's Changed

Full Changelog: https://github.com/google/zx/compare/6.0.6...6.0.7

zx - 6.0.4

Published by antonmedv over 2 years ago

What's Changed

Full Changelog: https://github.com/google/zx/compare/6.0.3...6.0.4

zx - 6.0.2

Published by antonmedv over 2 years ago

What's Changed

Full Changelog: https://github.com/google/zx/compare/6.0.1...6.0.2

zx -

Published by antonmedv over 2 years ago

What's Changed

zx -

Published by antonmedv over 2 years ago

72c8cf0 Added experimental startSpinner() function.
53a215e Added the signal field to ProcessOutput.
bf88f50 Added quiet() function (#313).
51fb6d5 Improved experemental echo()function.

import {echo} from 'zx/experimental'

// The echo() can be used both ways: 
echo`Current branch is ${branch}.`
// or
echo('Current branch is', branch)
import {startSpinner} from 'zx/experimental'

let stop = startSpinner()
await $`long-running command`
stop()
let p = nothrow($`while true; do :; done`)
setTimeout(() => p.kill('SIGKILL'), 1000)
let {signal} = await p
assert.equal(signal, 'SIGKILL')
await quiet($`grep something from-file`)
// Command and output will not be displayed.
zx - 5.1.0

Published by antonmedv over 2 years ago

98a9abb Added new experimental retry & echo functions.
f8bb1c7 Fixed bug where running script without extension removes existing .mjs files (#276).
792370a Increased maxBuffer to 200 MiB.
7fafa26 Added known issues doc.

Example:

import {echo, retry} from 'zx/experimental'

let branch = await $`git branch --show-current`
echo`Current branch is ${branch}.`

let {stdout} = await retry(5)`curl localhost`
zx - 5.0.0

Published by antonmedv over 2 years ago

   __/\\\\\\\\\\\__/\\\____/\\\_     
    _\///////\\\/__\///\\\/\\\/__    
     ______/\\\/______\///\\\/____   
      ____/\\\/_________/\\\/\\\___  
       __/\\\\\\\\\\\__/\\\/\///\\\_ 
        _\///////////__\///____\///__

Updated dependencies

 chalk               ^4.1.2  →   ^5.0.0
 globby             ^12.0.1  →  ^13.1.1
 node-fetch          ^2.6.1  →   ^3.2.0

Added feature

Added YAML package.

let {foo} = YAML.parse('foo: bar')

Breaking changes

This release drops build of CommonJS version and support for .ts extension by zx bin.

TypeScript is still supported, for example, via ts-node:

node --loader ts-node/esm script.ts

Also, a new Node version requirement is >= 16.0.0.

zx -

Published by antonmedv almost 3 years ago

  • 3f7c8ca Fixed --version argv parsing.
  • fe083c4 Fixed a process kill() with unhandled exception.
  • 5f54045 Fixed cd() to work with relative paths.
let p = $`sleep 99999`
await sleep(100)
p.kill()
zx - 4.2.0

Published by antonmedv about 3 years ago

  • Fixed export of zx/globals.
  • Improved usage CLI output.
zx -

Published by antonmedv about 3 years ago

  • Added missing path global 3f7e8fe3
zx - 4.1.0

Published by antonmedv about 3 years ago

  • 49d4868 Added zx/globals 49d4868
import 'zx/globals'
zx - 4.0.0

Published by antonmedv about 3 years ago

In this release:

  • Added kill() method 4915ff3
  • Added path package ce69a84
  • Added cjs support (#203)
  • Changed: register globals only in zx binary 33aaae4

New examples:

let {stdin, stdout} = $`npm init`

for await (let chunk of stdout) {
  if (chunk.includes('package name:')) stdin.write('test\n')
}