Hexer is a Node.js library for generating hexadecimal dumps of buffers and streams, offering synchronous, streaming, and CLI modes. Its primary function is to transform binary data into a human-readable hex format, similar to tools like `xxd`. The package provides various transform streams for different use cases, including spying on stream data, converting entire streams, or processing data in chunks. Key customization options include control over output formatting like line prefixes, column count, grouping, and custom decorators for byte representation. The current stable version is 1.5.0, which was last published over 7 years ago, indicating it is no longer actively maintained. This means it primarily supports older CommonJS (CJS) environments and Node.js versions (engines require `>= 0.10.x`) and lacks native ES module (ESM) support or recent updates to align with modern JavaScript practices. Alternatives like `hexy` exist that are more actively maintained and support modern Node.js and ESM.
npm install hexerVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of `hexer` to dump a Buffer to a string and to process a Readable stream with custom formatting options.
For ESM projects, use dynamic `import()` or consider a modern alternative like `hexy` that supports ESM. If using Node.js with `type: "module"` in `package.json`, you might need to wrap `require('hexer')` in an async function or use a compatibility layer if available.Evaluate compatibility through testing in your specific Node.js environment. For new projects or those requiring long-term stability and modern features, consider more actively maintained alternatives.
Ensure you are using `const hex = require('hexer');` for CommonJS environments. The main `hex` function is the direct export of the module, while `Spy` and `Transform` are properties on it.Either convert your project or specific file to CommonJS, or use `const hex = await import('hexer').then(m => m.default || m);` for dynamic ESM import, though full compatibility isn't guaranteed. It's often better to use a modern, ESM-compatible hex dumping library.No dependency data recorded yet.