RPM v3 package metadata parser in TypeScript with support for partial sync/stream parsing.
Basic.
import { parseRpmPackage } from "@dx3mod/rpm-parser";
const packageView = await parseRpmPackage(blob.stream());
packageView.name; // string
packageView.buildTime; // Date
packageView.raw.signature.entries.get(1004); // Entry
Partial parsing.
parseRpmPackage(stream, {
// partial parsing of necessary header entries
select: {
tags: [
InfoTag.Name,
InfoTag.Os,
InfoTag.Arch,
InfoTag.Summery,
InfoTag.Size,
],
},
capture: {
payload: true,
},
});