Registry / devops / gulp-untar

gulp-untar

JSON →
library0.0.8jsnpmunverified

gulp-untar is a Gulp plugin designed to extract `.tar` archive files directly within a Gulp build pipeline. It operates on vinyl files, accepting either stream or Buffer contents as input and consistently outputting files with Buffer contents. The package is currently at version 0.0.8, which was last published over 7 years ago (around November 2018). Due to its age and lack of updates, it is considered abandoned. Modern Gulp workflows (Gulp 5.0.0 released March 2024) and Node.js environments may encounter compatibility issues or prefer more actively maintained alternatives like `tar-fs` used with Node's built-in `zlib` for gzipped tarballs. Its primary differentiator was its simple integration into the Gulp stream paradigm for tar extraction at the time of its release.

npm install gulp-untar
INSTALL
IMPORT
SIG · GULP-UNTAR
G
gulp-untar
devopsjavascriptv0.0.8
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

untar
const untar = require('gulp-untar')
import untar from 'gulp-untar'
This package is CommonJS-only. ES module import syntax is not supported and will fail.
untar
const untar = require('gulp-untar')
import { untar } from 'gulp-untar'
The module exports a default function. Named imports are incorrect for this CJS module.

Demonstrates basic usage for extracting local tar files and a more complex scenario involving downloading a gzipped tarball from a URL, decompressing it with `gulp-gunzip`, and then extracting its contents.

const gulp = require('gulp'); const untar = require('gulp-untar'); const gunzip = require('gulp-gunzip'); const source = require('vinyl-source-stream'); const request = require('request'); // Example for fetching remote tar.gz // Basic task to extract local .tar files gulp.task('extract-local-tar', function () { return gulp.src('./archive/*.tar') .pipe(untar()) .pipe(gulp.dest('./extracted/local')); }); // Task to download a .tar.gz, gunzip, and then untar gulp.task('extract-remote-targz', function () { // In a real-world scenario, ensure 'request' is properly installed and error handled. // For production, consider 'got' or 'node-fetch' for modern HTTP requests. return request('https://example.com/path/to/some-file.tar.gz') // Replace with a real URL .pipe(source('some-file.tar.gz')) // Give the stream a filename .pipe(gunzip()) // Decompress the gzipped stream .pipe(untar()) // Extract the tarball .pipe(gulp.dest('./extracted/remote')); }); gulp.task('default', gulp.series('extract-local-tar', 'extract-remote-targz'));
Debug
Known issues
breakingThis package is unmaintained and has not been updated in over 7 years. It may not be compatible with newer versions of Node.js (e.g., Node.js 16+, 18+, 20+) or recent Gulp versions (Gulp 4+ / 5+), potentially leading to runtime errors or unexpected behavior due to API changes in underlying dependencies or Node.js core modules. The Gulp 5.0.0 release in March 2024 includes breaking changes like dropping Node.js <10.13 support and standardizing on `anymatch` for globbing.
fix
Consider using modern, actively maintained alternatives like `tar-fs` or `node-tar` directly in a custom Gulp task, or explore `gulp-decompress` which supports various archive formats, although its maintenance status should also be checked. Ensure any alternative is compatible with your Gulp and Node.js versions.
affects: >=0.0.8
gotchaThe plugin outputs vinyl files with `Buffer` contents, not streams. If subsequent Gulp plugins in your pipeline expect stream contents, this can cause issues or require additional processing to convert the Buffer back to a stream, which might negate the performance benefits of streaming.
fix
Be aware of the output content type. If a downstream plugin requires a stream, use `through2` or a similar utility to re-stream the buffer, or find plugins that explicitly handle Buffer input, or rewrite to use `gulp-buffer` to enforce buffer processing.
affects: >=0.0.1
gotchaThis package explicitly uses CommonJS `require()` syntax. It does not support ES modules (`import/export`) directly. Attempting to `import` it in an ES module context will result in a runtime error.
fix
Always use `const untar = require('gulp-untar');` in your `gulpfile.js` or any Node.js files consuming this package. If your project is primarily ESM, you might need a CommonJS wrapper or a different extraction library.
affects: >=0.0.1
securityAs an unmaintained package, `gulp-untar` (last updated over 7 years ago) does not receive security patches. It may contain known or undiscovered vulnerabilities, especially concerning archive parsing or file system operations, which could lead to supply chain attacks or arbitrary code execution if processing untrusted tarballs.
fix
It is strongly recommended to avoid using unmaintained packages in production environments. Migrate to a well-maintained library for tar extraction that has an active community and regular security audits. If migration is not immediately possible, thoroughly vet the source of any tarballs processed by `gulp-untar` and run the build process in a sandboxed, isolated environment.
affects: >=0.0.1
Errors
Common errors & fixes
TypeError: gulp-untar is not a function or is undefined
This error typically occurs when trying to use `gulp-untar` with ES module `import` syntax (`import untar from 'gulp-untar'`) in a project configured for ESM, or if `require` fails to resolve the module.
fix
Ensure you are using CommonJS `require` syntax: `const untar = require('gulp-untar');`. If the error persists, verify `gulp-untar` is correctly installed (`npm list gulp-untar`) and that your Node.js environment is compatible with older CommonJS modules.
Error: Not a tar file (or not in a recognized format)
This error may occur if the input file piped to `gulp-untar` is not a valid `.tar` archive, or if it's a gzipped tarball (`.tar.gz`) that has not been decompressed first. `gulp-untar` expects a raw `.tar` stream.
fix
If you are processing `.tar.gz` files, ensure you pass them through a gunzip plugin (e.g., `gulp-gunzip`) *before* `gulp-untar`. For example: `.pipe(gunzip()).pipe(untar())`. Verify the input files are indeed valid `.tar` archives.
Upgrade
Version history
0.0.8latest on npm
Audit
Dependencies
gulprequiredPeer dependency for any Gulp plugin.
Agent activity
4 hits · last 30 days
node
4
Resources
gulp-untar — npm install gulp-untar · libregistry