@filesync/core
v0.0.1
Published
Shared utilities for file synchronization operations.
Downloads
7
Readme
@filesync/core
Shared utilities for file synchronization operations.
Installation
npm install @filesync/coreAPI
findFiles(pattern, options?)
Recursively find files matching a pattern.
import { findFiles } from "@filesync/core";
const files = await findFiles("**/README.ai.md", { cwd: process.cwd() });fileEquals(path, content)
Check if a file exists and matches the given content.
import { fileEquals } from "@filesync/core";
const matches = await fileEquals("./README.md", "# Hello");writeIfChanged(path, content, options?)
Write content to a file only if it differs from existing content.
import { writeIfChanged } from "@filesync/core";
const changed = await writeIfChanged("./out.md", content, { dryRun: false });