Comparing version 1.10.1 to 1.11.0
{ | ||
"name": "zx", | ||
"version": "1.10.1", | ||
"version": "1.11.0", | ||
"description": "A tool for writing better scripts", | ||
@@ -5,0 +5,0 @@ "main": "index.mjs", |
@@ -57,4 +57,4 @@ # 🐚 zx | ||
When using `zx` via the executable or a shebang, all of the functions | ||
(`$`, `cd`, `fetch`, etc) are available straight away without any imports. | ||
All functions (`$`, `cd`, `fetch`, etc) are available straight away | ||
without any imports. | ||
@@ -291,2 +291,33 @@ ### ``$`command` `` | ||
### TypeScript scripts | ||
The `zx` can compile `.ts` scripts to `.mjs` by running `tsc` (should be | ||
installed on local machine). | ||
```bash | ||
zx examples/typescript.ts | ||
``` | ||
In TypeScript file include the `zx` package to import types: | ||
```ts | ||
import 'zx' | ||
``` | ||
Or reference the `zx` package via: | ||
```js | ||
/// <reference types="zx"/> | ||
``` | ||
Example: | ||
```ts | ||
#!/usr/bin/env zx | ||
import 'zx' | ||
void async function () { | ||
await $`ls -la` | ||
}() | ||
``` | ||
### Executing remote scripts | ||
@@ -293,0 +324,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33794
534
335