npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@trap_stevo/vigilite

v0.0.0

Published

Relentlessly vigilant. Vigilite gives you total awareness of the filesystem. Instantly detect additions, changes, and deletions across files and directories with precise filtering and event-driven control. Power live editing, automate workflows, trigger i

Downloads

4

Readme

🧿 Vigilite

Relentlessly vigilant. Vigilite gives you total awareness of the filesystem. Instantly detect additions, changes, and deletions across files and directories with precise filtering and event-driven control. Power live editing, automate workflows, trigger intelligent responses, and sync content in real time.
Detect instantly. Respond intelligently.


🌟 Features

  • 📂 Directory + File Watching – Monitor folders and individual files side-by-side
  • 🎯 Extension Filtering – Limit reactions to specific file types like .json, .md, .txt
  • Instant Event Signals – Get notified on added, changed, and deleted events
  • 🧠 Context-Rich Callbacks – Each signal includes label, path, name, type, timestamp, and readFile()
  • 🛡️ Custom Reveal Logic – Override how files are read before use
  • 🧪 Signal Filtering – Decide whether a change should trigger an event with onSignalIf
  • 🧘 Minimal Setup – No complex configuration—just pass a few paths and go

🧪 Use Cases

  • 🧬 Reactively reload config or docs as they change
  • 🧹 Automatically clean or archive generated files
  • 📦 Trigger workflows on file drops (e.g., uploads or exports)
  • 🔄 Sync local changes to remote destinations
  • 📊 Feed real-time file logs into monitoring dashboards

⚙️ System Requirements

| Requirement | Version | |----------------|--------------------| | Node.js | ≥ 18.x | | npm | ≥ 9.x (recommended)| | OS | Windows, macOS, Linux |


📜 API Specifications

🔧 Constructor

Initialize with an options object.

new Vigilite(options)

options Object

| Key | Description | Default | |-----------------|-----------------------------------------------------------------------------|--------------------------| | directories | Object of label → directory path to watch | {} | | extensions | Array of allowed extensions (e.g., .json, .md) | [".json", ".md"] | | onSignalIf | Optional async predicate (filePath, context) => boolean | null | | onReveal | Optional async function to customize file reading | null | | onSignal | Callback when a file change is detected | () => {} |


🧩 Signal Event Object

Each emitted event provides the following structure:

| Key | Description | |-------------|--------------------------------------------------| | label | The label of the directory or file watcher | | name | Filename without the extension | | type | "added", "changed", or "deleted" | | path | Full absolute file path | | timestamp | Event timestamp in ms | | readFile()| Async method to retrieve the file content |


🧰 Methods

| Method | Description | Async | |----------------------------------|---------------------------------------------------------|--------| | watch() | Begin watching all configured directories | ❌ | | stop() | Stop all watchers | ❌ | | watchFile(filePath, label?) | Watch a specific file | ❌ | | watchFiles(filePaths, prefix?) | Watch multiple files | ❌ | | unwatchFile(filePath) | Stop watching a specific file | ❌ | | unwatchDirectory(label) | Stop watching a specific directory by label | ❌ | | getWatchedFiles() | Get currently watched file paths | ❌ | | getWatchedDirectories() | Get labels of all watched directories | ❌ |


✨ Example Usage

📦 Installation

npm install @trap_stevo/vigilite

Watching Logs Directory

const Vigilite = require("@trap_stevo/vigilite");

const vigil = new Vigilite({
     directories : {
          logs : `${process.cwd()}/logs`
     },

     extensions : [".json", ".md"],

     onSignalIf : async (filePath, context) =>  {
          // Optional: skip ignored files
          return !filePath.includes("ignore");
     },

     onReveal : async (filePath, event, encoding) =>  {
          const fs = require("fs");
          return await fs.promises.readFile(filePath, encoding);
     },

     onSignal : async (event) =>  {
          console.log(`🔔 [${event.label}] "${event.name}" ${event.type}`);

          if (event.type !== "deleted") {
               const content = await event.readFile();
               console.log(`Content:\n${content}`);
               
               // - Logic to send to a client or service
          }
     }
});

vigil.watch();

✨ License

See License in LICENSE.md


🧠 Stay Aware. Stay in Control.

Whether watching a single file or orchestrating entire directory trees, Vigilite ensures that every change becomes an opportunity to act—cleanly, efficiently, and with intent.