fp

file-package

Package files

Showing:

Popularity

Downloads/wk

8

GitHub Stars

2

Maintenance

Last Commit

6yrs ago

Contributors

2

Package

Dependencies

3

Size (min+gzip)

31.0KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

file-package - Simplified file package

Compress files, then package them together.

var filePackage = require('file-package');

filePackage('src', 'path/dest.zip');

filePackage('src', 'path/dest.zip', {
  level: 9,            // compression level, 0-9
  filter: [
    '**/*',
    '!**/*.html'
  ],
  packageRoot: '',
  done: function(size) {

  }
});

grunt

var filePackage = require('file-package');

grunt.registerTask('zip', function() {
  var done = this.async();
  filePackage('src', 'path/src.zip', {
    level: 9,
    packageRoot: 'root',
    done: function(size) {
      console.log(size);
      done();
    }
  });
});

options

  • mode {number}
    Set the file permissions.
  • level {number} [level = 1]
    Compression level, 0 - 9.
  • filter {string|array} [filter = null][filter params description](https://github.com/douzi8/file-match#filter-description)
  • packageRoot {string} [packageRoot = '']
    File root path with archive files.
  • done {function} [done = function(size) {}]
    Compress done callback.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100