In Node.js
The loaders accept Node.js Buffers directly, so you don't need to slice ArrayBuffers yourself.
PDS3
For an attached label (label and pixels in the same file), pass only the file:
Parsing stops at the label's END statement, and ^IMAGE points into the same file.
PDS4
Node.js has no built-in DOMParser, so parseXML loads @xmldom/xmldom on demand.
Batch conversion
For quick jobs, the CLI already does this with pds2img -d ./data.
Inspecting labels
Use parseLBL to read PDS3 metadata without decoding the pixels: