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

gulp-ts-pkg-app

v0.1.0

Published

A tool to dump versions for easy delta data interchange.

Downloads

2

Readme

Features of MD5Dumper

MD5Dumper is a tool that:

  • Can generate a canonical representation of every file under a directory. (the Fsmap format)
  • Can minify Fsmap representations to reduce interchanged data size.
  • Can summarize Fsmap to reduce interchanged data size for initial checksum.
  • Compare minified Fsmap and local directory Fsmap, and detect missing/corrupted/extra files

Motivation behind MD5Dumper

MD5Dumper aims to automatise file system synchronization between distinct ends. Intended specially for auto-patch servers.

Due to the way auto-patch servers interact with clients, data traffic on each check is really important to optimize. MD5Dumper attempts to minimize the size of data interchanged between those checks.

Anatomy of an Fsmap

An Fsmap is a canonical representation of a directory. It is generated by recursively traversing a directory in a sorted way and creating MD5 hashes of every file's content + file's relative path.

declare type Fsmap = FsmapEntry[];

declare type FsmapEntry = {
  index: number; // Index to ensure traverse order
  path?: string; // Relative file system path
  md5: string; // h(relativePath + content)
};

How should Auto-patcher Servers use it?

  1. Once development is done, store built artifacts under a directory. (Let's call it ./target for this example)
  2. Generate fsmap of ./target dir and store it under ./autopatcher/build.fsmap. This file will be used to deserialize on the server side, client won't need this one.
  3. Minify fsmap of ./target and store it under ./autopatcher/build.min.fsmap
  4. Summarize fsmap of ./target and store it under ./autopatcher/summary.md5
  5. Serve those last 2 files for clients to fetch; build.min.fsmap and summary.md5. (They will need them to perform checksum :p)
  6. Fsmap maps Indices to relative file paths. Serve files and their relative paths by indices using the fsmap as a lookup table! Easy peasy!

How should Auto-patcher Clients use it?

  1. Generate fsmap of the local directory
  2. Fetch summary.md5 from the server and compare with local fsmap's summary.
  3. If they match, then the client is up to date! Else, fetch build.min.fsmap from the server.
  4. Check for the differences between build.min.fsmap and local fsmap. The diff functionality of MD5Dumper will yield "invalid local files" and "missing file indices".
  5. Delete invalid local files.
  6. Request every missing file by their indices. Server shall know which file is represented by the indice! Server will respond you with the file blob and it's relative path!
  7. The client should be up to date after all the steps! Easy peasy!