INNER CODE UNIT · JavaScript
wrapAsync
danburzo/percollate · index.js:712
const wrapAsync = inner => {
return new Promise((resolve, reject) => {
inner(resolve, reject).catch(reject);
});
};
return wrapAsync(async (resolve, reject) => {
const template_base = fileURLToPath(
new URL('templates/epub/', import.meta.url)
);
const output = fs.createWriteStream(output_path);
const archive = archiver('zip', {
zlib: {
// Best DEFLATE compression level
level: 9
}
});