google/zx

feat: expose `version`

Closed this issue · 0 comments

Sometime zx gets major updates, which potentially can change the behavior of scripts. Let's provide a bit more control for this case.

import {version} from 'zx'

const [major] = (version || '').split('.').map(Number)
if (major < 6)
  throw new Error('zx >= 6 is required')
npx zx /smth/script.mjs