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.
broccoli-caching-writer
Advanced tools
Readme
Drop-in-replacement for
broccoli-writer adding a thin
caching layer based on the computed hash of the input directory trees. If any
file in an input node has changed, the build
method will be called,
otherwise (if input is the same) the results of the last build
call will be
used instead.
var Plugin = require('broccoli-caching-writer');
MyPlugin.prototype = Object.create(Plugin.prototype);
MyPlugin.prototype.constructor = MyPlugin;
function MyPlugin(inputNodes, options) {
options = options || {};
// options.inputFiles === array of globs, to consider for the cache key
Plugin.call(this, inputNodes, {
annotation: options.annotation
});
}
MyPlugin.prototype.build = function() {
// cache has been busted
// do anything, for example:
// 1. read from this.inputPaths
// 2. do something based on the result
// 3. and then, write to this.outputPath
};
new CachingWriter(inputNodes, options)
Call this base class constructor from your subclass constructor.
inputNodes
: An array of input nodes.
options
:
name
, annotation
, persistentOutput
: Same as
broccoli-plugin;
see there.
cacheInclude
(default: []
): An array of regular expressions that files and directories in an input node must pass (match at least one pattern) in order to be included in the cache hash for rebuilds. In other words, a whitelist of patterns that identify which files and/or directories can trigger a rebuild.
cacheExclude
(default: []
): An array of regular expressions that files and directories in an input node cannot pass in order to be included in the cache hash for rebuilds. In other words, a blacklist of patterns that identify which files and/or directories will never trigger a rebuild.
Note, in the case when a file or directory matches both an include and exlude pattern, the exclude pattern wins
plugin.listFiles
list files matched, helpful as it allows us avoid a second glob, lexicographically sorted by relativePath.
plugin.listEntries
list entries (stat objects) of files matched, helpful when further FS information is required on rebuild, lexicographically sorted by relativePath.
I know, right?
Running the tests:
npm install
npm test
This project is distributed under the MIT license.
FAQs
Broccoli plugin that allows simple caching (while still allowing N:N) based on the input tree hash.
The npm package broccoli-caching-writer receives a total of 237,048 weekly downloads. As such, broccoli-caching-writer popularity was classified as popular.
We found that broccoli-caching-writer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.