
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
directory-sync
Advanced tools
Easily synchronize directories between two machines over the internet.
Synchronize directories between multiple machines over network with the ability to be synchronized in real-time.
DirectorySync requires Node.js version 14+ and can be installed using Node Package Manager (npm).
npm i directory-sync
Below is a simple snippet for setting up a server and hosting directories which can then be mirrored on remote machines.
import { Server } from 'directory-sync';
// Create a Server instance which will host your desired directories
const server = new Server({
port: 8080,
auth: 'some-secret-key' // You may use this key to authentice mirrors
});
// Bind approriate listeners for logging/error handling on the Server instance
server.on('log', (code, message) => console.log(`[SERVER][${code}] ${message}`));
server.on('error', (error) => console.log(`[SERVER]`, error));
// Host a directory with a custom "name" and then the "path" to the directory on your system
server.host('my-directory-1', './path/to/some-directory');
// You may also specify which files to keep/ignore with filters when hosting a directory
server.host('my-directory-2', './path/to/some-directory-2', {
filters: {
keep: {
files: ['configuration.json'], // We also want to host this one configuration.json file
extensions: ['.html', '.css', '.js'] // We only want to host HTML, CSS & JS files
},
ignore: {
directories: ['node_modules'] // We do not want to host any files from node modules
}
}
});
Below is a simple snippet for setting up a mirror and synchronizing a remote directory from the example above.
import { Mirror } from 'directory-sync';
// Create a mirror instance to mirror the "my-directory-2" directory from above example
const my_directory_2_mirror = new Mirror('my-directory-2', {
path: './mirrored-some-directory-2', // Provide the path where this directory should be mirrored
hostname: '127.0.0.1', // IP/Host address of the Server instance machine
port: 8080, // Port of the Server instance machine
auth: 'some-secret-key', // Authentication key to access the Server instance
});
// Bind approriate listeners for logging/error handling on the Mirror instance
my_directory_2_mirror.on('log', (code, message) => console.log(`[MIRROR][${code}] ${message}`));
my_directory_2_mirror.on('error', (error) => console.log(`[MIRROR]`, error));
FAQs
Easily synchronize directories between two machines over the internet.
The npm package directory-sync receives a total of 16 weekly downloads. As such, directory-sync popularity was classified as not popular.
We found that directory-sync demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.