damonbauer / npm-build-boilerplate

A collection of packages that build a website using npm scripts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm task for zip files

mario-areias opened this issue · comments

Thanks for all these tips. I am trying to achieve something similar to zip (or gzip or tar) my artifacts. So far I've seen zlib, node-tar and node-zip to accomplish that. However, they are not one line of code which I could use in my package.json file.

Do you know how to do that in a simple manner?

@mario-areias - since npm scripts are just an alias for bash commands, you should be able to run zip in your terminal. Inside of an npm script, that would look something like:

"archive": "zip -r output_filename input_directory"

More details: http://snipplr.com/view/36580/unix-zip-file-or-directory/

Thanks for replying back. Unfortunately, that's exactly what I want to avoid. I would like a javascript solution rather than a terminal solution. What I am using now is something like

 "copy:artifacts": "node scripts/copy-artifacts.js" 

And then I use standard node libraries to zip inside the copy-artifacts.js. But thanks anyway. Feel free to close this.