Skip to content

Commit 0c37d36

Browse files
committed
docs: added tar stream format in the docs
1 parent 7911b84 commit 0c37d36

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/Generator.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,24 @@ import * as utils from './utils';
6666
* storing the actual value. These are the currently supported keys for
6767
* the extended metadata:
6868
* - path (corresponding to file path if it is longer than 255 characters)
69+
*
70+
* The high-level diagram of a tar file looks like the following.
71+
* - [File header]
72+
* - [Data]
73+
* - [Data]
74+
* - [Extended header]
75+
* - [Data]
76+
* - [File header]
77+
* - [Data]
78+
* - [Data]
79+
* - [Directory header]
80+
* - [Null chunk]
81+
* - [Null chunk]
82+
*
83+
* A file header preceedes file data. A directory header has no data. An
84+
* extended header is the same as a file header, but it has differnet metadata
85+
* than one, and must be immediately followed by either a file or a directory
86+
* header. Two null chunks are always at the end, marking the end of archive.
6987
*/
7088
class Generator {
7189
protected state: GeneratorState = GeneratorState.HEADER;

src/Parser.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,24 @@ import * as utils from './utils';
6161
* storing the actual value. These are the currently supported keys for
6262
* the extended metadata:
6363
* - path (corresponding to file path if it is longer than 255 characters)
64+
*
65+
* The high-level diagram of a tar file looks like the following.
66+
* - [File header]
67+
* - [Data]
68+
* - [Data]
69+
* - [Extended header]
70+
* - [Data]
71+
* - [File header]
72+
* - [Data]
73+
* - [Data]
74+
* - [Directory header]
75+
* - [Null chunk]
76+
* - [Null chunk]
77+
*
78+
* A file header preceedes file data. A directory header has no data. An
79+
* extended header is the same as a file header, but it has differnet metadata
80+
* than one, and must be immediately followed by either a file or a directory
81+
* header. Two null chunks are always at the end, marking the end of archive.
6482
*/
6583
class Parser {
6684
protected state: ParserState = ParserState.HEADER;

0 commit comments

Comments
 (0)