feat proposal: addAllFromFolder
Closed this issue · 2 comments
sombreroEnPuntas commented
It would be convenient to add all files on a folder, like:
// const folder = "./test-folder/"
addAllFromFolder(folder) {
fs.readdirSync(folder).forEach((file) => {
this._addEntireDocument(`${folder}${file}`)
})
}
mojoaxel commented
for now you could do something like this (untested):
const glob = require('glob');
glob(FOLDER + '/*.pdf', {},
(err, files) =>
files.forEach(file =>
merger.add(file)
)
);
mojoaxel commented
This conflicts with browser support (#17). Because there is a easy workaround I think we can close this.