nanotar is a compact and efficient utility library designed for creating and parsing Tar archives across various JavaScript environments, including Node.js, browsers, and edge runtimes. It prioritizes performance and a minimal footprint, making it suitable for resource-constrained applications. The current stable version is 0.3.0, with releases occurring as needed for enhancements and fixes, as demonstrated by recent updates to 0.2.0 and 0.3.0. A key differentiator is its universal JavaScript runtime compatibility and the inclusion of TypeScript types, ensuring robust development. It offers core functionalities for both generating `.tar` files and extracting their contents, supporting common Tar specifications. Unlike some alternatives, it aims to be dependency-free and focuses purely on the Tar format without additional compression (like gzip) built-in, allowing users to combine it with other compression libraries as needed.
npm install nanotarVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to create a Tar archive from an array of files and then parse its contents back into individual items, showing basic file and folder handling.
Review any code that consumes `parseTar` output, especially for archives using extended headers or less common file types, and adapt to potentially richer item metadata or type handling.
Ensure your application does not rely on unsanitized path formats from tar archives. Validate paths after parsing if your application has specific requirements beyond what `nanotar`'s sanitization provides.
Consider migrating custom filtering/metadata extraction logic to utilize the built-in `filter` and `metaOnly` options for potentially improved performance and clarity.
Ensure the input to `parseTar` is a `Uint8Array` instance representing a valid tar archive. Verify file reading or network fetching produces the correct binary data.
Convert `Buffer` instances to `Uint8Array` before passing them to `createTar` or `parseTar` (e.g., `new Uint8Array(buffer)`). Ensure all binary data is handled as `Uint8Array`.
No dependency data recorded yet.