Comparing version 0.1.1 to 1.0.0
{ | ||
"name": "tar.gz", | ||
"version": "0.1.1", | ||
"description": "Native gzip compression and decompression utility for Node.js.", | ||
"keywords": [ | ||
"compression", | ||
"decompression", | ||
"compress", | ||
"decompress", | ||
"tar", | ||
"tape archive", | ||
"tape", | ||
"archive", | ||
"gzip", | ||
"gz" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/cranic/node-tar.gz.git" | ||
}, | ||
"author": "Cranic Tecnologia <contato@cranic.com.br>", | ||
"contributors": [ | ||
"Alan Hoffmeister <alan@cranic.com.br>" | ||
], | ||
"dependencies": { | ||
"fstream": "0.1.x", | ||
"tar": "0.1.x", | ||
"commander": "1.1.x" | ||
}, | ||
"devDependencies": { | ||
"coffee-script" : "1.4.x", | ||
"walk" : "2.2.x", | ||
"wrench" : "1.4.x", | ||
"vows" : "0.7.x" | ||
}, | ||
"main": "./lib/targz", | ||
"engines": { | ||
"node": ">=0.6.0" | ||
}, | ||
"maint.me" : true, | ||
"scripts": { | ||
"prepublish": "cake build" | ||
}, | ||
"bin" : { | ||
"targz": "./bin/targz" | ||
}, | ||
"bugs": { | ||
"url": "http://github.com/cranic/node-tar.gz/issues" | ||
}, | ||
"license" : "MIT <http://opensource.org/licenses/MIT>" | ||
"name": "tar.gz", | ||
"version": "1.0.0", | ||
"description": "Pure javascript tarball tools for Node.js", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha --tdd --bail test/**/*-test.js", | ||
"travis": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -R spec test/**/*-test.js && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf ./coverage" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/alanhoff/node-tar.gz.git" | ||
}, | ||
"keywords": [ | ||
"compression", | ||
"decompression", | ||
"compress", | ||
"decompress", | ||
"tar", | ||
"tape", | ||
"archive", | ||
"tape", | ||
"arquive", | ||
"gzip", | ||
"gz", | ||
"tarball" | ||
], | ||
"author": "Alan Hoffmeister <alanhoffmeister@gmail.com>", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/alanhoff/node-tar.gz/issues" | ||
}, | ||
"bin": { | ||
"targz": "bin/targz" | ||
}, | ||
"homepage": "https://github.com/alanhoff/node-tar.gz#readme", | ||
"dependencies": { | ||
"bluebird": "^2.9.34", | ||
"chai": "^3.2.0", | ||
"commander": "^2.8.1", | ||
"fstream": "^1.0.7", | ||
"mocha": "^2.2.5", | ||
"mout": "^0.11.0", | ||
"tar": "^2.1.1" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^2.11.3", | ||
"istanbul": "^0.3.17", | ||
"temp": "^0.8.3" | ||
} | ||
} |
194
README.md
@@ -1,103 +0,159 @@ | ||
# **node-tar.gz** | ||
Native gzip compression and decompression utility for Node.js. | ||
# tar.gz | ||
[![Coverage Status](https://coveralls.io/repos/alanhoff/node-tar.gz/badge.svg?branch=master)][0] | ||
[![Travis](https://travis-ci.org/alanhoff/node-tar.gz.svg)][1] | ||
[![Dependencies](https://david-dm.org/alanhoff/node-tar.gz.svg)][2] | ||
### **Installation** | ||
Pure gzip tarball tools and sugar for Node.js | ||
For simple installation: | ||
### API | ||
npm install tar.gz | ||
* `createReadStream` reads a directory and returns a readable stream containing | ||
a gzipped tarball. | ||
If you want to use the `targz` command line: | ||
```javascript | ||
var fs = require('fs'); | ||
var targz = require('tar.gz'); | ||
npm intall -g tar.gz | ||
// Create all streams that we need | ||
var read = targz().createReadStream('/some/directory'); | ||
var write = fs.createWriteStream('compressed.tar.gz'); | ||
### **Usage** | ||
// Let the magic happen | ||
read.pipe(write); | ||
``` | ||
At the moment this package can only compress a folder and everything that | ||
is inside it. To compress something is easy: | ||
* `createWriteStream` writes the content from a tarball stream into some | ||
directory. | ||
var targz = require('tar.gz'); | ||
var compress = new targz().compress('/path/to/compress', '/path/to/store.tar.gz', function(err){ | ||
if(err) | ||
console.log(err); | ||
```javascript | ||
var request = require('request'); | ||
var targz = require('tar.gz'); | ||
console.log('The compression has ended!'); | ||
}); | ||
// Streams | ||
var read = request.get('https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz'); | ||
var write = targz().createWriteStream('/some/directory'); | ||
With the same easy you can extract a gziped file: | ||
read.pipe(write); | ||
``` | ||
var targz = require('tar.gz'); | ||
var compress = new targz().extract('/path/to/stored.tar.gz', '/path/to/extract', function(err){ | ||
if(err) | ||
console.log(err); | ||
* `createParseStream` reads a tarball stream and emits `entry` for every entry | ||
parsed . | ||
console.log('The extraction has ended!'); | ||
}); | ||
```javascript | ||
var request = require('request'); | ||
var targz = require('tar.gz'); | ||
You can pass some configuration parameters to the constructor before compress: | ||
// Streams | ||
var read = request.get('https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz'); | ||
var parse = targz().createParseStream(); | ||
var targz = require('tar.gz'); | ||
parse.on('entry', function(entry){ | ||
console.log(entry.path); | ||
}); | ||
var level = 6 //the compression level from 0-9, default: 6 | ||
var memLevel = 6 //the memory allocation level from 1-9, default: 6 | ||
var proprietary = true //to include or not proprietary headers, default: true | ||
read.pipe(parse); | ||
``` | ||
var compress = new targz(level, memLevel, proprietary).compress(...) | ||
* `compress` compress one directory and saves the result to a tarball. | ||
### **Command line** | ||
```javascript | ||
// Using callbacks | ||
targz().compress('/home/myuser', '/bkp/backup.tar.gz', function(err){ | ||
if(err) | ||
console.log('Something is wrong ', err.stack); | ||
$ targz -h | ||
console.log('Job done!'); | ||
}); | ||
Usage: targz [options] | ||
// Using promises | ||
targz().compress('/home/myuser', '/bkp/backup.tar.gz') | ||
.then(function(){ | ||
console.log('Job done!'); | ||
}) | ||
.catch(function(err){ | ||
console.log('Something is wrong ', err.stack); | ||
}); | ||
``` | ||
Options: | ||
* `extract` extracts a tarball into a directory. | ||
-h, --help output usage information | ||
-V, --version output the version number | ||
-c, --compress Compress folder to archive | ||
-x, --extract Extract archive to folder | ||
-l, --level [n] Compression level from 0-9. Default 6. | ||
-m, --memory [n] Memory allocation level from 1-9. Default 6. | ||
-n, --noproprietary Remove proprietary headers. | ||
```javascript | ||
// Using callbacks | ||
targz().extract('/bkp/backup.tar.gz', '/home/myuser', function(err){ | ||
if(err) | ||
console.log('Something is wrong ', err.stack); | ||
Examples: | ||
console.log('Job done!'); | ||
}); | ||
Default compression | ||
$ targz -c /folder/to/compres /path/to/archive.tar.gz | ||
// Using promises | ||
targz().extract('/bkp/backup.tar.gz', '/home/myuser') | ||
.then(function(){ | ||
console.log('Job done!'); | ||
}) | ||
.catch(function(err){ | ||
console.log('Something is wrong ', err.stack); | ||
}); | ||
``` | ||
Extracting some archive | ||
$ targz -x /path/to/archive.tar.gz /destination/folder | ||
### Gzip options | ||
Maximum compression | ||
$ targz -l 9 -m 9 -c /folder/to/compres /path/to/archive.tar.gz | ||
You can pass any `zlib.createGzip` options to `tar.gz` constructor, like so: | ||
```javascript | ||
var tarball = new TarGz({ | ||
level: 9, // Maximum compression | ||
memLevel: 9 | ||
}); | ||
``` | ||
### **TODO** | ||
### Command line | ||
* Vows.js tests | ||
* Single file compression | ||
* Add more todos... | ||
It's also possible to use `tar.gz` as a command line utility, you just need to | ||
install it globally with `npm install -g tar.gz`. Here is the help command | ||
output. | ||
``` | ||
Usage: targz [options] [command] | ||
### **License (MIT)** | ||
Commands: | ||
Copyright (C) 2012 Cranic Tecnologia e Informática LTDA | ||
extract|e <source> <target> Extracts the source tarball into the target directory | ||
compress|c [options] <source> <target> Compress the source directory into the target tarball | ||
list|l <source> List all paths inside the source tarball | ||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files | ||
(the "Software"), to deal in the Software without restriction, | ||
including without limitation the rights to use, copy, modify, merge, | ||
publish, distribute, sublicense, and/or sell copies of the Software, | ||
and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
Options: | ||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
-h, --help output usage information | ||
-V, --version output the version number | ||
``` | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
### Testing | ||
```bash | ||
git clone git@github.com:alanhoff/node-tar.gz.git | ||
cd node-tar.gz | ||
npm install && npm test | ||
``` | ||
### License (ISC) | ||
``` | ||
Copyright (c) 2015, Alan Hoffmeister <alanhoffmeister@gmail.com> | ||
Permission to use, copy, modify, and distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
``` | ||
[0]: https://coveralls.io/github/alanhoff/node-tar.gz | ||
[1]: https://travis-ci.org/alanhoff/node-tar.gz | ||
[2]: https://david-dm.org/alanhoff/node-tar.gz |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
3
0
154
0
160
12633
7
6
2
+ Addedbluebird@^2.9.34
+ Addedchai@^3.2.0
+ Addedmocha@^2.2.5
+ Addedmout@^0.11.0
+ Addedassertion-error@1.1.0(transitive)
+ Addedbluebird@2.11.0(transitive)
+ Addedchai@3.5.0(transitive)
+ Addedcommander@0.6.12.20.32.3.0(transitive)
+ Addeddebug@2.2.0(transitive)
+ Addeddeep-eql@0.1.3(transitive)
+ Addeddiff@1.4.0(transitive)
+ Addedescape-string-regexp@1.0.2(transitive)
+ Addedfstream@1.0.12(transitive)
+ Addedglob@3.2.11(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedgrowl@1.9.2(transitive)
+ Addedjade@0.26.3(transitive)
+ Addedlru-cache@2.7.3(transitive)
+ Addedminimatch@0.3.0(transitive)
+ Addedminimist@0.0.8(transitive)
+ Addedmkdirp@0.3.00.5.1(transitive)
+ Addedmocha@2.5.3(transitive)
+ Addedmout@0.11.1(transitive)
+ Addedms@0.7.1(transitive)
+ Addedsigmund@1.0.1(transitive)
+ Addedsupports-color@1.2.0(transitive)
+ Addedtar@2.2.2(transitive)
+ Addedto-iso-string@0.0.2(transitive)
+ Addedtype-detect@0.1.11.0.0(transitive)
- Removedcommander@1.1.1(transitive)
- Removedfstream@0.1.31(transitive)
- Removedgraceful-fs@3.0.12(transitive)
- Removedkeypress@0.1.0(transitive)
- Removednatives@1.1.6(transitive)
- Removedtar@0.1.20(transitive)
Updatedcommander@^2.8.1
Updatedfstream@^1.0.7
Updatedtar@^2.1.1