co-prepare-deployment-package
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -5,12 +5,10 @@ var fileSystem = require('fs') | ||
// config = { | ||
// packageName: 'my-super-depoloyment-pack.zip', | ||
// outDir: 'deployDir', | ||
// globs: ['my-file.txt', 'my-folder/**/*'] | ||
// } | ||
function pack (config) { | ||
var packageName = config.packageName || 'PACKAGE.zip' | ||
var outDir = config.outDir || '/' | ||
var outDirFull = path.join(__dirname, outDir, packageName) | ||
var output = fileSystem.createWriteStream(__dirname + outDir + packageName) | ||
if (!config.outDir) { | ||
console.log('outDir missing!') | ||
return | ||
} | ||
var fullOutDir = path.join(config.outDir, packageName) | ||
var output = fileSystem.createWriteStream(fullOutDir) | ||
var archive = archiver('zip') | ||
@@ -22,3 +20,3 @@ | ||
console.log('Package has been created at:') | ||
console.log(outDirFull) | ||
console.log(fullOutDir) | ||
console.log('Package size: ' + archive.pointer() + ' total bytes') | ||
@@ -25,0 +23,0 @@ }) |
@@ -0,5 +1,6 @@ | ||
var path = require('path') | ||
module.exports = { | ||
packageName: 'DEPLOY_PACKAGE.zip', | ||
outDir: '/', | ||
outDir: path.join(__dirname, ''), | ||
globs: ['example/suitcase/muffler.txt', 'example/suitcase/zip-bag/**/*'] | ||
} |
{ | ||
"name": "co-prepare-deployment-package", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Zip a bunch of files and folders for deployment", | ||
@@ -5,0 +5,0 @@ "main": "co-prepare-deployment-package.js", |
## co-prepare-deployment-package | ||
### How to use | ||
```javascript | ||
var path = require('path') | ||
require('co-prepare-deployment-package').pack({ | ||
packageName: 'my-super-depoloyment-pack.zip', | ||
outDir: path.join(__dirname, 'deployDir'), | ||
globs: ['my-file.txt', 'my-folder/**/*'] | ||
}) | ||
``` | ||
Run example: | ||
@@ -4,0 +14,0 @@ - Go to package dir `cd co-prepare-deployment-package` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2531
16
39