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 🙏

© 2024 – Pkg Stats / Ryan Hefner

docker-windows-detect-changes

v1.1.1

Published

A small tool meant to help with file change detection within Linux containers on Docker for Windows.

Downloads

21

Readme

npm node pipeline Coverage Status npm npm

Docker Windows Detect Changes

A small tool meant to help with file change detection within Linux containers on Docker for Windows. How it works:

  1. An API server is started within the Docker container
  2. A file watcher is started in the Windows powershell.
  3. The file watcher detects changes and sends an HTTP request to the server.
  4. The server performs a "touch" on a file set in the config, which propagates the change detection within the container.

Table Of Contents

Getting Started

First, you'll need to install docker-windows-detect-changes both in Windows (outside the Docker container) and inside the Docker container.

npm i @lemmsoft/docker-windows-detect changes

If you don't want to install NodeJS and NPM in Windows itself, simply download the latest binary from the build folder.

{
	"port": 1234,
	"paths": [
		{
			"fileToTouch": "./back-end/main.js",
			"ignoredRegexString": "./back-end/main.js",
			"pathToWatch": "./back-end"
		}
	]
}

The above configuration will start a change detection API server at port 1234, and will set up the change detection watcher to touch the file "./back-end/main.js" whenever something in the "./back-end" directory and its subdirectories is added/changed/deleted. Then, in the docker container, go to the directory containing the file you just created and start the change detection API server by running

docker-windows-detect-changes -s

This will start the server at port 1234. After the server is started, outside the container - in Windows - navigate to the directory containging the .json config file and run

docker-windows-detect-changes

This will start the file watcher for the "pathToWatch" directory. That's it - you're good to go!

Config File Reference

// docker-windows-detect-changes.json
{
	"port": number, // the port that the server will be started on; required if using the -s flag when running the docker-windows-detect-changes command
	// the configuration for the paths that are to be watched; required when running the docker-windows-detect-changes command without the -s flag
	"paths": [
		{
			"fileToTouch": string, // the file that will be touched when a change is detected, which will in turn propagate the changes inside the docker container
			"ignoredRegexString": string | RegExp, // a string or regular expression, matching the files or folders to be excluded from the file watcher; must contain the "fileToTouch" file, otherwise an infinite loop will be created
			"pathToWatch": string // the path to the file or folder to be watched
		}
	]
}

Full CLI Reference

Usage: docker-windows-detect-changes [options] Options:   -s       starts a ChangeDetectionServer at the TCP port provided using the -p argument   -p       required and only used if -s is provided; specifies the TCP port at which the ChangeDetectionServer should be started   -c       optional; specifies the config file to use for starting the ChangeDetectionWatcher; if not provided, the script will look for a file named "docker-windows-detect-changes.json" in the process' working directory   -h, --help   display the help menu