Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
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.
$ npm install tar-pack
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 to false
) Set this to true
to 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 a fstream.DirReader
instead of a string for folder.filter
(defaults to entry => true
) A function that takes an entry and returns true
if it should be included in the package and false
if 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 a fstream.DirReader
instead of a string for folder.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.gz
or .tar
)'file'
, incating that the extracted package was just a single file (extracted to defaultName
, see options)Basic Options:
defaultName
(defaults to index.js
) If the package is a single file, rather than a tarball, it will be "extracted" to this file name, set to false
to disable.Advanced Options (you probably don't need any of these):
gid
- (defaults to null
) the gid
to use when writing filesuid
- (defaults to null
) the uid
to use when writing filesdmode
- (defaults to 0777
) The mode to use when creating directoriesfmode
- (defaults to 0666
) The mode to use when creating filesunsafe
- (defaults to false
) (on non win32 OSes it overrides gid
and uid
with the current processes IDs)BSD
FAQs
Package and un-package modules of some sort (in tar/gz bundles).
The npm package tar-pack receives a total of 165,257 weekly downloads. As such, tar-pack popularity was classified as popular.
We found that tar-pack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.