archiver-utils provides essential utility functions designed to support the `archiver` package, primarily focusing on file system and stream operations. As of its current stable version, 5.0.2, it offers robust capabilities for tasks such as directory traversal (`fs.walkdir`) and stream interface detection (`stream.detect`). The package maintains a relatively frequent release cadence, often aligning major version updates with Node.js EOL cycles and significant dependency upgrades. Key differentiators include its tight integration with the `archiver` ecosystem, providing specialized helpers that enhance the core archiving functionality, ensuring efficient and reliable handling of file and stream inputs. It is not intended as a standalone archiving solution but as a foundational helper for `archiver` itself.
npm install archiver-utilsVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use `fs.walkdir` to recursively traverse a directory and log file/directory information, then cleans up.
Upgrade your Node.js runtime to version 14 or higher. The current recommended minimum is Node.js 14.
Upgrade your Node.js runtime to version 12 or higher. For current releases, Node.js 14+ is required.
Review any custom stream detection logic in your application to ensure it aligns with the improved detection mechanism in 5.0.2. Test thoroughly if using custom stream implementations.
Check the changelogs for `readable-stream` v4 and `glob` v9/v10 if unexpected issues related to stream handling or file globbing arise after upgrading `archiver-utils`.
Ensure you are using the correct import syntax for your module environment. For ESM, use `import { fs } from 'archiver-utils';`. For CommonJS, use `const { fs } = require('archiver-utils');` or `const archiverUtils = require('archiver-utils'); const fs = archiverUtils.fs;`.Verify that the path variable passed to `fs.walkdir` is a valid string. Log the path before the call to debug its value.
If your project is an ES Module, switch to `import { fs } from 'archiver-utils';`. If the issue persists with other dependencies, ensure consistent module type usage across your project or use dynamic `import()` for CJS-only modules within an ESM context if absolutely necessary.