-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpack.js
More file actions
19 lines (14 loc) · 601 Bytes
/
pack.js
File metadata and controls
19 lines (14 loc) · 601 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* jshint node: true, esversion: 6 */
'use strict';
const fs = require('fs');
const jetpack = require('fs-jetpack');
const zip = require('node-zip')();
const jsFile = jetpack.read('./dist/simple-inventory.js', 'utf8');
const cssFile = jetpack.read('./dist/simple-inventory.css', 'utf8');
const license = jetpack.read('./LICENSE', 'utf8');
zip
.file('simple-inventory.js', jsFile)
.file('simple-inventory.css', cssFile)
.file('LICENSE.txt', license);
const bin = zip.generate({ base64 : false, compression : 'DEFLATE' });
fs.writeFileSync('./dist/simple-inventory.zip', bin, 'binary');