Socket
Socket
Sign inDemoInstall

zx

Package Overview
Dependencies
Maintainers
2
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zx - npm Package Compare versions

Comparing version 1.11.0 to 1.12.0

1

index.d.ts

@@ -41,2 +41,3 @@ // Copyright 2021 Google LLC

readonly stderr: Readable
readonly exitCode: Promise<number>

@@ -43,0 +44,0 @@ pipe(dest: ProcessPromise<ProcessOutput> | Writable): ProcessPromise<ProcessOutput>

2

package.json
{
"name": "zx",
"version": "1.11.0",
"version": "1.12.0",
"description": "A tool for writing better scripts",

@@ -5,0 +5,0 @@ "main": "index.mjs",

@@ -98,2 +98,3 @@ # 🐚 zx

readonly stderr: Readable
readonly exitCode: Promise<number>
pipe(dest): ProcessPromise<T>

@@ -115,5 +116,5 @@ }

class ProcessOutput {
readonly exitCode: number
readonly stdout: string
readonly stderr: string
readonly exitCode: number
toString(): string

@@ -177,2 +178,36 @@ }

### `nothrow()`
Changes behavior of `$` to not throw an exception on non-zero exit codes.
```ts
function nothrow<P>(p: P): P
```
Usage:
```js
await nothrow($`grep something from-file`)
// Inside a pipe():
await $`find ./examples -type f -print0`
.pipe(nothrow($`xargs -0 grep something`))
.pipe($`wc -l`)
```
If only the `exitCode` is needed, you can use the next code instead:
```js
if (await $`[[ -d path ]]`.exitCode == 0) {
...
}
// Equivalent of:
if ((await nothrow($`[[ -d path ]]`)).exitCode == 0) {
...
}
```
### `chalk` package

@@ -295,4 +330,3 @@

The `zx` can compile `.ts` scripts to `.mjs` by running `tsc` (should be
installed on local machine).
The `zx` can compile `.ts` scripts to `.mjs` and execute them.

@@ -299,0 +333,0 @@ ```bash

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc