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-untarVerified import paths — ran on the pinned version, not inferred.
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.
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.
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.
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.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.
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.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.