Skip to content

Commit

Permalink
readme: brush up wheel, per-lang quick start
Browse files Browse the repository at this point in the history
  • Loading branch information
Will committed Oct 7, 2024
1 parent d106c99 commit ddc6ece
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Watcher

[![Builds for Distribution](https://github.com/e-dant/watcher/actions/workflows/wheels.yml/badge.svg)](https://github.com/e-dant/watcher/actions/workflows/wheels.yml)
[![Builds for Distribution](https://github.com/e-dant/watcher/actions/workflows/dist.yml/badge.svg)](https://github.com/e-dant/watcher/actions/workflows/dist.yml)
[![Python Wheels](https://github.com/e-dant/watcher/actions/workflows/wheels.yml/badge.svg)](https://github.com/e-dant/watcher/actions/workflows/wheels.yml)
[![Conan Center](https://img.shields.io/conan/v/watcher)](https://conan.io/center/recipes/watcher)
[![CodeQL Tests](https://github.com/e-dant/watcher/actions/workflows/codeql.yml/badge.svg)](https://github.com/e-dant/watcher/actions/workflows/codeql.yml)
Expand Down Expand Up @@ -80,7 +80,7 @@ void callback(struct wtr_watcher_event event, void* _ctx) {
}

int main() {
void* watcher = wtr_watcher_open("/", callback, NULL);
void* watcher = wtr_watcher_open(".", callback, NULL);
getchar();
return ! wtr_watcher_close(watcher);
}
Expand All @@ -93,18 +93,18 @@ int main() {
```python
from watcher import Watch
with Watch("/", print):
with Watch(".", print):
input()
```
</details>

<details>
<summary>Node.js/TypeScript/JavaScript</summary>
<summary>Node.js</summary>

```javascript
import * as watcher from 'watcher';

var w = watcher.watch('/', (event) => {
var w = watcher.watch('.', (event) => {
console.log(event);
});

Expand All @@ -123,6 +123,8 @@ rename file /home/e-dant/dev/watcher/.git/refs/heads/next.lock -> /home/e-dant/d
create file /home/e-dant/dev/watcher/.git/HEAD.lock
```

(Output format depending on the language.)

Enjoy!

---
Expand Down

0 comments on commit ddc6ece

Please sign in to comment.