https://github.com/federicoceratto/nim-fswatch
  
  
    Nim wrapper for the fswatch library 
    https://github.com/federicoceratto/nim-fswatch
  
filesystem fswatch libfswatch library nim nim-lang nimlang
        Last synced: 8 months ago 
        JSON representation
    
Nim wrapper for the fswatch library
- Host: GitHub
- URL: https://github.com/federicoceratto/nim-fswatch
- Owner: FedericoCeratto
- License: gpl-3.0
- Created: 2019-04-03T19:10:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-09T16:16:28.000Z (over 5 years ago)
- Last Synced: 2025-01-05T20:42:22.804Z (10 months ago)
- Topics: filesystem, fswatch, libfswatch, library, nim, nim-lang, nimlang
- Language: Nim
- Size: 21.5 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 4
- 
            Metadata Files:
            - Readme: README.adoc
- License: LICENSE
 
Awesome Lists containing this project
README
          ## libfswatch wrapper
Cross-platform filesystem event monitor for Nim.
Wraps the https://github.com/emcrisostomo/fswatch[libfswatch] library.
image:https://img.shields.io/badge/status-alpha-orange.svg[badge]
image:https://img.shields.io/badge/Nim%20version-0.19.0+-green.svg[Nim version]
image:https://img.shields.io/github/tag/FedericoCeratto/nim-fswatch.svg[tags]
image:https://img.shields.io/badge/License-GPL%20v3-blue.svg[License]
### Usage
[source,bash]
----
sudo apt-get install libfswatch11
nimble install fswatch
----
[source,nim]
----
import times, fswatch
var monitor = newMonitor(latency=0.01)
monitor.add("my-file-path")
proc callback(eg: EventGroup) =
  for e in eg:
    echo e.path, " ", $e.kind, " ", e.time.utc()
monitor.setCallback(callback)
# blocks here
monitor.start()
----
### Contributing
Testing and PRs are welcome.