rpm-parser

RPM v3 package metadata parser in TypeScript for use in any environment.

Get Started

For Deno.

import { parseRpmMetadata } from "https://deno.land/x/rpm_parser/mod.ts";

High-level user API

// parse from stream in chunks
const pkg = await parseRpmMetadata(blob.stream());

pkg.name; // string
pkg.buildTime; // Date

with direct access

pkg.raw.signature.entries.get(1004); // Entry

and configuration of optimization.

parseRpmMetadata(
  stream,
  {
    // partial parsing of necessary header entries
    select: {
      tags: [
        InfoTag.Name,
        InfoTag.Os,
        InfoTag.Arch,
        InfoTag.Summery,
        InfoTag.Size,
      ],
    },
  },
);

Documentation

References