11 releases (7 breaking)

0.8.0 Jun 22, 2022
0.7.2 Mar 22, 2022
0.7.1 Jul 13, 2021
0.6.1 Jan 25, 2021
0.2.0 Nov 23, 2019

#236 in Filesystem

Download history 10708/week @ 2023-12-11 7505/week @ 2023-12-18 3097/week @ 2023-12-25 5816/week @ 2024-01-01 9225/week @ 2024-01-08 13568/week @ 2024-01-15 10852/week @ 2024-01-22 10301/week @ 2024-01-29 12193/week @ 2024-02-05 12977/week @ 2024-02-12 11411/week @ 2024-02-19 13330/week @ 2024-02-26 12855/week @ 2024-03-04 13540/week @ 2024-03-11 13569/week @ 2024-03-18 12786/week @ 2024-03-25

53,529 downloads per month
Used in 5 crates (4 directly)

Apache-2.0

190KB
4K SLoC

watchman-logo

Watchman

A file watching service.

Purpose

Watchman exists to watch files and record when they actually change. It can also trigger actions (such as rebuilding assets) when matching files change.

Documentation

Head on over to https://facebook.github.io/watchman/

License

Watchman is made available under the terms of the MIT License. See the LICENSE file that accompanies this distribution for the full text of the license.

Support

Watchman is primarily maintained by the source control team at Meta Platforms, Inc. We support:

  • Windows and macOS builds
  • Linux builds on recent Ubuntu and Fedora releases
  • Watchman's compatibility commitment
  • Python, Rust, and JavaScript clients

Support for additional operating systems, release packaging, and language bindings is community-maintained:

  • Homebrew
  • FreeBSD
  • Solaris

Please submit a GitHub issue to report any troubles.

Contributing

Please see the contributing guide.


lib.rs:

This crate provides a client to the watchman file watching service.

Start with the Connector struct and use it to connect and return a Client struct, Client::resolve_root to resolve a path and initiate a watch, and then Client::query to perform a query, or Client::subscribe to subscribe to file changes in real time.

This example shows how to connect and expand a glob from the current working directory:

use watchman_client::prelude::*;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  let mut client = Connector::new().connect().await?;
  let resolved = client
     .resolve_root(CanonicalPath::canonicalize(".")?)
     .await?;

  // Basic globs -> names
  let files = client.glob(&resolved, &["**/*.rs"]).await?;
  println!("files: {:#?}", files);
  Ok(())
}

Dependencies

~4–12MB
~110K SLoC