{"id":13276,"library":"gulp-untar","title":"Gulp Tarball Extractor","description":"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.","status":"abandoned","version":"0.0.8","language":"javascript","source_language":"en","source_url":"https://github.com/jmerrifield/gulp-untar","tags":["javascript","gulpplugin","gulp","tar"],"install":[{"cmd":"npm install gulp-untar","lang":"bash","label":"npm"},{"cmd":"yarn add gulp-untar","lang":"bash","label":"yarn"},{"cmd":"pnpm add gulp-untar","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for any Gulp plugin.","package":"gulp","optional":false}],"imports":[{"note":"This package is CommonJS-only. ES module import syntax is not supported and will fail.","wrong":"import untar from 'gulp-untar'","symbol":"untar","correct":"const untar = require('gulp-untar')"},{"note":"The module exports a default function. Named imports are incorrect for this CJS module.","wrong":"import { untar } from 'gulp-untar'","symbol":"untar","correct":"const untar = require('gulp-untar')"}],"quickstart":{"code":"const gulp = require('gulp');\nconst untar = require('gulp-untar');\nconst gunzip = require('gulp-gunzip');\nconst source = require('vinyl-source-stream');\nconst request = require('request'); // Example for fetching remote tar.gz\n\n// Basic task to extract local .tar files\ngulp.task('extract-local-tar', function () {\n  return gulp.src('./archive/*.tar')\n    .pipe(untar())\n    .pipe(gulp.dest('./extracted/local'));\n});\n\n// Task to download a .tar.gz, gunzip, and then untar\ngulp.task('extract-remote-targz', function () {\n  // In a real-world scenario, ensure 'request' is properly installed and error handled.\n  // For production, consider 'got' or 'node-fetch' for modern HTTP requests.\n  return request('https://example.com/path/to/some-file.tar.gz') // Replace with a real URL\n    .pipe(source('some-file.tar.gz')) // Give the stream a filename\n    .pipe(gunzip()) // Decompress the gzipped stream\n    .pipe(untar()) // Extract the tarball\n    .pipe(gulp.dest('./extracted/remote'));\n});\n\ngulp.task('default', gulp.series('extract-local-tar', 'extract-remote-targz'));","lang":"javascript","description":"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."},"warnings":[{"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.","message":"This 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.","severity":"breaking","affected_versions":">=0.0.8"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":">=0.0.1"},{"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.","message":"This 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.","severity":"gotcha","affected_versions":">=0.0.1"},{"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.","message":"As 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.","severity":"security","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"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.","cause":"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.","error":"TypeError: gulp-untar is not a function or is undefined"},{"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.","cause":"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.","error":"Error: Not a tar file (or not in a recognized format)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null}