downloads
Across all versions.
Download trend unavailable.
compatibility
Runtime metadata.
keywords
Tagged topics.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
This is a very basic/alpha version of a JS Mac OSX xar implementation.
Pack a directory like:
var xar = require('xar')
xar.pack(dir, {compresssion: 'gzip'}).pipe(process.stdout)Compression formats supported: none, gzip
Default is gzip
Unpack a directory like:
var fs =require('fs')
xar.unpack(data, function (err, file, content) {
if (err) return console.error(err)
if (file.type[0] === 'directory') {
fs.mkdirSync(file.path)
} else {
fs.writeFileSync(file.path, content)
}
})returns a readable stream
It is not possible to create the archive in a streaming fashion though, since it has a TOC in the beginning. The file is constructed in a tmp file, which is then streamed to you.
callback called for each file with (err, file, content)
file is the parsed header from the TOC
Note that this is mainly made for testing the pack function, if someone
wants to improve it, feel free to create a PR!
Estimated unpacked size across 16 packages.
4.3 MB
Includes dependencies.
7 direct · 3 outdated
^1.0.0
1.0.1
^0.4.15
0.6.2
^1.2.0
1.2.8
^2.0.0
5.1.1
^2.0.0
5.0.12
^1.0.0
1.0.0
^2.0.0
2.0.0