Skip to content

Commit

Permalink
Created package.json and updated examples with new require scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
beatgammit committed Jun 27, 2011
1 parent 3833853 commit b4e6946
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -12,7 +12,7 @@ Example

Tar:

var Tar = require('tar-async').Tar,
var Tar = require('tar-async/tar'), // or require('tar-async').Tar
tape = new Tar({output: require('fs').createWriteStream('out.tar')});

tape.append('test.txt', 'Woohoo!! Tar me up Scotty!', function () {
Expand All @@ -23,7 +23,7 @@ Simple huh? A Tar instance is an EventEmitter, and emits these events: 'end', 'd

Untar:

var Untar = require('tar-async').Untar,
var Untar = require('tar-async/untar'), // or require('tar-async').Untar
fs = require('fs'),
untar = new Untar(function (err, header, fileStream) {
console.log(header.filename);
Expand Down
20 changes: 20 additions & 0 deletions lib/package.json
@@ -0,0 +1,20 @@
{
"author": "T. Jameson Little <t.jameson.little@gmail.com>",
"name": "tar-async",
"description": "Asynchronous tar and untar",
"keywords": ["tar", "asynchronous", "stream", "async"],
"version": "1.0.0",
"repository": {
"type": "git",
"url": "git://github.com/beatgammit/tar-async.git"
},
"main": "index.js",
"directories": {
"lib": "."
},
"engines": {
"node": ">=0.1.90"
},
"dependencies": {},
"devDependencies": {}
}
8 changes: 4 additions & 4 deletions test/nofs.js → test/tar.js
Expand Up @@ -3,19 +3,19 @@
'use strict';

var fs = require('fs'),
Tar = require('../lib/index').Tar,
Tar = require('tar-async/tar'),
tape,
contents,
stats;

contents = fs.readFileSync('./nofs.js', 'utf8');
contents = fs.readFileSync('./tar.js', 'utf8');

tape = new Tar({output: require('fs').createWriteStream('out.tar')});

stats = fs.lstatSync('./nofs.js');
stats = fs.lstatSync('./tar.js');

tape.append('waja.js', contents);
tape.append('piped.js', fs.createReadStream('./nofs.js', {encoding: 'utf8'}), {size: stats.size});
tape.append('piped.js', fs.createReadStream('./tar.js', {encoding: 'utf8'}), {size: stats.size});
tape.append('justText.txt', 'This is just some text. Fun, huh?', function () {
tape.close();
});
Expand Down
2 changes: 1 addition & 1 deletion test/untar.js
Expand Up @@ -3,7 +3,7 @@
'use strict';

var fs = require('fs'),
Untar = require('../lib/index').Untar,
Untar = require('tar-async/untar'),
untar = new Untar(function (err, header, fileStream) {
if (err) {
return;
Expand Down

0 comments on commit b4e6946

Please sign in to comment.