From 611c4c86829b1068ba4a160554d4552579ba9f40 Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Fri, 20 Dec 2013 20:54:01 +0100 Subject: [PATCH] moved some sections --- README.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 561a351..0c90ac0 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,26 @@ extract.on('finish', function() { pack.pipe(extract); ``` +## Headers + +The header object using in `entry` should contain the following properties. +Most of these values can be found by stating a file. + +``` js +{ + name: 'path/to/this/entry.txt', + size: 1314, // entry size. defaults to 0 + mode: 0644, // entry mode. defaults to to 0755 for dirs and 0644 otherwise + mtime: new Date(), // last modified date for entry + type: 'file', // type of entry. can be file|directory|link|block|character|fifo + linkname: 'path', // + uid: 0, // uid of entry owner. defaults to 0 + gid: 0, // gid of entry owner. defaults to 0 + uname: 'maf', // uname of entry owner. defaults to null + gname: 'wheel', // gname of entry owner. defaults to null +} +``` + ## Modifying existing tarballs Using tar-stream it is easy to rewrite paths / change modes etc in an existing tarball. @@ -84,26 +104,6 @@ oldTarball.pipe(extract); pack.pipe(newTarball); ``` -## Headers - -The header object using in `entry` should contain the following properties. -Most of these values can be found by stating a file. - -``` js -{ - name: 'path/to/this/entry.txt', - size: 1314, // entry size. defaults to 0 - mode: 0644, // entry mode. defaults to to 0755 for dirs and 0644 otherwise - mtime: new Date(), // last modified date for entry - type: 'file', // type of entry. can be file|directory|link|block|character|fifo - linkname: 'path', // - uid: 0, // uid of entry owner. defaults to 0 - gid: 0, // gid of entry owner. defaults to 0 - uname: 'maf', // uname of entry owner. defaults to null - gname: 'wheel', // gname of entry owner. defaults to null -} -``` - # License MIT