Package Exports
- tar-pack
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tar-pack) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Tar Pack
Package and un-package modules of some sort (in tar/gz bundles). This is mostly useful for package managers. Note that it doesn't check for or touch package.json so it can be used even if that's not the way you store your package info.
Installation
$ npm install tar-packAPI
pack(folder|packer, tarball, [options,] cb)
Pack the folder at folder into a gzipped tarball located at tarball then call cb with an optional error. Files ignored by .gitignore will not be in the package.
You can optionally pass a fstream.DirReader directly, instead of folder. For example, to create an npm package, do:
pack(require("fstream-npm")(folder), tarball, [options], cb)Options:
noProprietary(defaults tofalse) Set this totrueto prevent any proprietary attributes being added to the tarball. These attributes are allowed by the spec, but may trip up some poorly written tarball parsers.ignoreFiles(defaults to['.gitignore']) These files can specify files to be excluded from the package using the syntax of.gitignore. This option is ignored if you parse afstream.DirReaderinstead of a string for folder.filter(defaults toentry => true) A function that takes an entry and returnstrueif it should be included in the package andfalseif it should not. Entryies are of the form{path, basename, dirname, type}where (type is "Directory" or "File"). This function is ignored if you parse afstream.DirReaderinstead of a string for folder.
unpack(tarball, folder, [options,] cb)
Unpack the tarball at tarball into a folder at folder`. N.B. the output folder will be removed first if it already exists.
The callback is called with an optional error and, as its second argument, a string which is one of:
'directory', indicating that the extracted package was a directory (either.tar.gzor.tar)'file', incating that the extracted package was just a single file (extracted todefaultName, see options)
Basic Options:
defaultName(defaults toindex.js) If the package is a single file, rather than a tarball, it will be "extracted" to this file name, set tofalseto disable.
Advanced Options (you probably don't need any of these):
gid- (defaults tonull) thegidto use when writing filesuid- (defaults tonull) theuidto use when writing filesdmode- (defaults to0777) The mode to use when creating directoriesfmode- (defaults to0666) The mode to use when creating filesunsafe- (defaults tofalse) (on non win32 OSes it overridesgidanduidwith the current processes IDs)
License
BSD

