Writers should be able to expose an init function that gets called only once before writeBundle or writeResource gets called.
module.exports = function(lasso, config) {
lasso.config.writer = {
async init (lassoContext) {
// This will get called once before either `writeBundle` or `writeResource`
},
async writeBundle (reader, lassoContext) {
...
},
async writeResource (reader, lassoContext) {
...
}
};
};
Writers should be able to expose an
init
function that gets called only once beforewriteBundle
orwriteResource
gets called.