Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions watch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ source files change in a directory, shutdown the current invocation _gracefully_
and restart it.

```
deno -A jsr:@effectionx/watch npm start
npx @effectionx/watch npm start
```

or, under Deno:

```
deno run -A npm:@effectionx/watch npm start
```

## Graceful Shutdown
Expand All @@ -24,13 +30,13 @@ source control (not ignored).

## Use it as an Effection library

Most of the time, you will use this an executable. However, if you want to
create your own watch from within a library, you can But if you want to write
your own
Most of the time, you will use this as an executable. If you want to build your
own watch from within a library, the `/lib` export is the same machinery the
command is built on.

```ts
import { each, main } from "effection";
import { watch } from "@effectionx/watch";
import { watch } from "@effectionx/watch/lib";

await main(function* () {
const changes = watch({
Expand Down
1 change: 1 addition & 0 deletions watch/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node
import process from "node:process";
import { each, exit, main, scoped, spawn } from "effection";
import { z } from "zod";
Expand Down
5 changes: 4 additions & 1 deletion watch/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "@effectionx/watch",
"description": "Run commands and restart them gracefully when source files change",
"version": "0.4.7",
"version": "0.4.8",
Comment thread
taras marked this conversation as resolved.
"keywords": ["process"],
"type": "module",
"main": "./dist/main.js",
"types": "./dist/main.d.ts",
"bin": {
"watch": "./dist/main.js"
},
Comment thread
taras marked this conversation as resolved.
"exports": {
".": {
"types": "./dist/main.d.ts",
Expand Down
Loading