npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rpm-codec

v4.0.16

Published

Encode/decode rpm lead/header(s)

Downloads

43

Readme

npm License minified size downloads GitHub Issues Build Status Styled with prettier Commitizen friendly Known Vulnerabilities Coverage Status

rpm-codec

Encode/decode rpm lead/header(s)

== Which version of RPM is supported?

According to <> there are, well, three versions of rpm:

  1. 'THE' rpm
  2. rpm.org, a public effort starting around 2007 producing versions 4.8 to 4.10
  3. rpm v5 creating version 5

The first rpm i got my hand on was 4.4, so for now the one and only implementation is 4.4. Do not expect any newer features such as compression other than gzip (lzma, xz, ...).

RPM file format specification

RPM files are persisted in network byte order and consist of four parts.

Lead

Our lead looks like this:

magic (0-3):: Magic value for both 'file' and rpm utilities ('ED AB EE DB')

major (4):: RPM Major version ('03')

minor (5):: RPM minor version ('00')

type (6-9):: Type binary ('00 00 00 00'). Type source ('00 00 00 01') not supported yet.

deprecated (10-95):: The rest is not used any more because its format is inflexible. Content is superseded by the header. It's only use is to support non-rpm utilities such as 'file' that can identify rpms based on a magic value. (85 times '00')

Signature

Signature format is equal to header format. This lib does not support checksums because the order of the checksum field would require the complete rpm structure to be processed before streaming could continue.

Header

Supported index types:

  • NULL = 0
  • CHAR = 1
  • INT8 = 2
  • INT16 = 3
  • INT32 = 4
  • INT64 = 5
  • STRING = 6
  • BIN = 7
  • STRING_ARRAY = 8

Payload

A gzip,xz compressed cpio structure carries the rpm payload. Other compressions algorithms exist, and are supported by newer versions of 'rpm', but for now it's gzip.

API

Table of Contents

RPMHeader

decoded rpm header

Type: Object

Properties

RPMDecoder

Decodes the rpm header.

Parameters

Returns RPMHeader

defaultEntryHandler

null handler simply skips content

Parameters

contentDecoder

Decode the body part of an rpm stream

Parameters

  • result RPMHeader
  • entryHandler EntryHandler (optional, default defaultEntryHandler)

TYPE_NULL

Not Implemented

Type: number

TYPE_STRING

variable, NUL terminated

Type: number

TYPE_STRING_ARRAY

Variable, sequence of NUL terminated strings

Type: number

TYPE_I18NSTRING

Variable, sequence of NUL terminated strings

Type: number

Bibliography

[bibliography]