Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
broccoli-writer
Advanced tools
Base class for Broccoli plugins that write an output tree. Most plugins fall into this category (the exception being plugins that just point at an existing directory on the file system, like broccoli-bower), so they will be implemented either using this base class or using a derived, more specific base class.
This base class's main purpose is to create and clean up the temporary output directory for you.
npm --save broccoli-writer
Write your plugin like so:
var Writer = require('broccoli-writer');
module.exports = MyCompiler;
MyCompiler.prototype = Object.create(Writer.prototype);
MyCompiler.prototype.constructor = MyCompiler;
function MyCompiler (arg1, arg2, ...) {
if (!(this instanceof MyCompiler)) return new MyCompiler(arg1, arg2, ...);
...
};
MyCompiler.prototype.write = function (readTree, destDir) {
...
};
Inside MyCompiler.prototype.write
, readTree
is supplied by
Broccoli -- call
readTree(someInputTree)
to read another tree. destDir
is the path to a
newly-created temporary directory created by the Writer
base class. Place
all the output files you wish to generate in this directory.
If you want to do something asynchronous, return a promise that resolves when you are done.
In the MyCompiler
constructor, you don't need to call the Writer
base
class constructor.
Your plugin can be used in Brocfile.js
like so:
var compileSomething = require('broccoli-my-compiler');
var outputTree = compileSomething(arg1, arg2, ...)
0.1.1
cleanup
methodFAQs
Helper base class for Broccoli plugins that write output files
The npm package broccoli-writer receives a total of 9,385 weekly downloads. As such, broccoli-writer popularity was classified as popular.
We found that broccoli-writer 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.