Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 16, 2024 via pnpm

watchpack 2.4.0

Wrapper library for directory and file watching.
Package summary
Share
0
issues
3
licenses
1
BSD-2-Clause
1
ISC
1
MIT
Package created
9 Oct 2014
Version published
2 Jun 2022
Maintainers
1
Total deps
3
Direct deps
2
License
MIT

Issues

0
This package has no issues

Licenses

BSD 2-Clause "Simplified" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
glob-to-regexp@0.4.1

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
graceful-fs@4.2.11

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
watchpack@2.4.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of watchpack 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
glob-to-regexp0.4.14.38 kBBSD-2-Clause
prod
graceful-fs4.2.119.57 kBISC
prod

Visualizations

Frequently Asked Questions

What does watchpack do?

Watchpack is a powerful wrapper library used for directory and file watching. In essence, it provides a high-level API for monitoring changes in your file system. It relies on a three-tier design to ensure that only one watcher exists per directory, helping to keep the watcher count minimal. The functionality of Watchpack extends beyond merely observing changes. It can also commence watching in the past, which allows watching to begin after data has been read from the file. This utility also caters to symlink watchers, choosing not to follow symlinks directly but rather to observe them independently.

How do you use watchpack?

To utilize Watchpack in your project, you begin by installing the package via npm and then require it in your JavaScript file. The basic steps involve creating a new Watchpack instance and defining its options such as aggregateTimeout, poll, followSymlinks, and ignored. Then, you use the wp.watch() function to start watching your selected files and directories.

Here's a quick usage walkthrough in code:

// Required: Step 1 - Import Watchpack
var Watchpack = require("watchpack");

// Required: Step 2 - Create a new Watchpack instance with specified options
var wp = new Watchpack({
    aggregateTimeout: 1000,
    poll: true,
    followSymlinks: true,
    ignored: "**/.git"
});

// Required: Step 3 - Start watching your desired files and directories
wp.watch({
    files: myListOfFiles,
    directories: myListOfDirectories,
    missing: myListOfNotExistingItems,
    startTime: Date.now() - 10000
});

You can also add event listeners to your Watchpack instance to react when changes, removals, or groups of events (aggregated) occur. Additionally, facilities for pausing, closing, and retrieving aggregated info are part of the Watchpack utility.

Remember that customization options like aggregateTimeout, poll, followSymlinks, and ignored can greatly impact how Watchpack performs in your unique scenario. Ensure you understand what each of these configurations entails to utilize Watchpack to its fullest potential.

Where are the watchpack docs?

For documentation regarding the use of Watchpack, you can refer to the README document on its Github repository page - https://github.com/webpack/watchpack. The README includes a thorough explanation of watchpack's concept, its API, and usage examples. This will guide you in understanding how to integrate and customize Watchpack in your project.