Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
tree-sync
Advanced tools
Readme
A module for repeated efficient synchronizing two directories.
// input/a/{a.js,b.js}
// output/
const tree = new TreeSync('input', 'output');
tree.sync();
// output is now contains copies of everything that is in input
fs.unlink('/input/a/b.js');
// input / output have diverged
tree.sync();
// difference is calculated and efficient patch to update `output` is created and applied
Under the hood, this library uses walk-sync to traverse files and folders. You may optionally pass in options to selectively include or ignore files and directories. These whitelisted properties (ignore
and globs
) will be passed to walk-sync.
// Assume the following folder structure...
// input/
// foo/
// foo.js
// bar.js
// bar/
// foo-bar.js
const tree = new TreeSync('input', 'output', {
ignore: ['**/b']
});
tree.sync();
// We now expect output to contain foo/, but not bar/.
// Any changes made to bar/ won't be synced to output, and the contents of bar/ won't be traversed.
// Assume the following folder structure...
// input/
// foo/
// foo.js
// bar.js
// bar/
// foo-bar.js
const tree = new TreeSync('input', 'output', {
globs: ['foo', 'foo/bar.js']
});
tree.sync();
// We now expect output to contain foo/bar.js, but nothing else.
// Be careful when using this property! You'll need to make sure that if you're including a file, it's parent
// path is also included, or you'll get an error when tree-sync tries to copy the file over.
FAQs
A module for repeated efficient synchronizing two directories.
The npm package tree-sync receives a total of 275,858 weekly downloads. As such, tree-sync popularity was classified as popular.
We found that tree-sync demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.