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

keynote-archives

v2.0.1

Published

Contains Keynote Archive serializers and deserializers

Downloads

3

Readme

keynote-archives

Utilities to process Keynote presentations (*.key).

Protobuf files were taken from psobot / keynote-parser. Read more about the iWorkArchive format here. Generated by Keynote version 12.2.1 (current as of December 2022).

How to use?

npm install keynote-archives

Then import the package and unzip the inner files, dechunk the single IWA files and split each chunk into objects.

import { unzip, isIwaFile, dechunk, uncompress, splitObjectsAs, KeynoteArchives } from 'keynote-archives';

export async function decode(data: Uint8Array): void {
  for await(const entry of unzip(data)) {
    if(isIwaFile(entry.name)) {
      for await(const snappyChunk of dechunk(entry.data)) {
        const chunk = await uncompress(snappyChunk.data);
        for await(const message of splitObjectsAs(chunk, KeynoteArchives)) {
          ...
        }
      }
    }
  }
}

Documentation

This package provides asynchronous functions to read IWA format. Here is a small overview about the terminology:

Terminology

Here is what they do in detail:

  1. unzip: opens an Uint8Array as Zip file and returns multiple file entries, until EOF.
  2. dechunk: opens an Uint8Array as IWA file and returns multiple Snappy-compressed chunks as Uint8Array, until EOF.
  3. uncompress: opens an Uint8Array as Snappy chunk and returns uncompressed data as Uint8Array.
  4. splitObjectsAs: opens an Uint8 array as IWA file chunk and returns multiple Protobuf-decoded IWA (JSON) objects, until EOF or error.
  5. decode: (everything at once) opens an Uint8 array as Zip file and returns multiple ArchiveEntrys containing either a file or a list of IWA chunks with multiple IWA objects associated with an IWA file.
  6. analyzeChunkFor: analyzes an Uint8Array IWA chunk for ArchiveInfo segments and returns archive infos and gaps for further analysis.

You will also get access to all archives types:

  • AllArchives is a list of all archives.
  • for each Protobuf package XXX, you will get:
    • a list of all package-related archives XXX$Archives
    • a namespace XXX with all archives XXX.yyy
  • a map for all Keynote archives by type number KeynoteArchives

Workflow for contributors

npm install                      //Initialize NPM package...
npm run clean                    //Clean artifacts from last build
npm run generate-ts-from-proto   //Generate Typescript files from Protobuf files...
npm run generate-index-from-ts   //Create the index...
npm run build                    //Transpile to Javascript...

License

MIT license