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

hamarc

v1.0.1

Published

Hamster archive

Downloads

3

Readme

This program is public domain and is used for parsing and making Hamster
archive. Can access in memory or with files.

The exported object is a function for an abstract constructor; the
"prototype" property of it is the base class for what follows. The other
properties exported are File and Memory, which are constructors.

The constructed object has properties (mainly on the prototype object):

._get(address,length)
  Read from the file into a buffer. Can be used with .enumerate() in order
  to read the data of the enumerated lumps.

.caseFold
  A boolean value, normally true. If true, causes the .get() method to
  perform a case-insensitive comparison.

.enumerate()
  Returns a generator, which yields objects with three properties each,
  one yield per lump. The properties are called "name", which is the name
  of the lump, "address", which is the start address of the lump in the
  file, and "length", which is the size of the lump. The order of yielding
  is the order of the lumps in the file.

.get(name,[start],[length])
  Retrieve the data of a lump as a Buffer instance, or null if the lump
  does not exist. The start and length is within the lump; the start is
  therefore normally zero.

.nameEncoding
  Can be "ascii", "binary", or "utf8"; controls the character encoding for
  lump names. The default is "ascii".

.put(name,data)
  Add a new lump. The name is a string and data is the buffer.

You cannot delete or alter any existing lumps nor should you use both
reading and writing for the same file at the same time. If you want to
write, you should start with an empty file, or use append mode (the Memory
constructor is automatically using append mode).

The File constructor takes a file descriptor as its argument, and reads
and writes the file.

The Memory constructor takes a Buffer instance as its argument (optional;
if not provided, creates an empty buffer), and reads the buffer. If you
write new lumps, then the property called _buf can access the data.

If you are subclassing it, you must define _get(address,length) and
_put(buf) methods on the prototype for the subclass.

The format of a Hamster archive is zero or more "lumps" concatenated
together. Each lump consists of a null-terminated name, followed by the
32-bit data size in PDP byte order, followed by the data.