### Programmatic usage from within Node.js Source: https://github.com/nfriedly/node-bestzip/blob/master/readme.md Example of how to use bestzip programmatically from Node.js. ```javascript import zip from 'bestzip'; // use version 2.x for require() // zip a single source await zip({ source: 'build/*', destination: './destination.zip' }) // zip multiple sources, starting in a different CWD (current working directory) await zip({ source: ['img1.jpg', 'img2.jpg', 'imgn.jpg'], destination: '../images.zip', cwd: './images/' // optional, defaults to process.cwd() }) // Promises also work: zip({source, destination}).then(...).catch(...) // Callbacks also work: zip(destination, sources, callback) ``` -------------------------------- ### Command line usage within package.json scripts Source: https://github.com/nfriedly/node-bestzip/blob/master/readme.md Example of how to use bestzip within package.json scripts. ```json { //... "scripts": { "build" "...", "zip": "bestzip bundle.zip build/*", "upload": "....", "deploy": "npm run build && npm run zip && npm run upload" } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.