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

@gitcobra/anzip

v1.0.8

Published

super easy way to create an uncompressed zip file.

Downloads

25

Readme

AnZip

It creates an uncompressed zip file.

  • extremely easy to use
  • all methods are synchronous
  • ES3 compatible

This code contains no compression processes, so it is simple and fast.

Purpose

When your JavaScript code produces large amounts of files and wants to let users save them, AnZip provides easy way to combine the files into a zip file so that they need only a single download dialog or confirmation or something.

Installation

npm install @gitcobra/anzip

ESM:

import AnZip from '@gitcobra/anzip'

Node:

const AnZip = require('@gitcobra/anzip');

UMD:

<script src="https://cdn.jsdelivr.net/npm/@gitcobra/anzip/dist/anzip.umd.min.js"></script>

WSH (Windows Scripting Host):

https://cdn.jsdelivr.net/npm/@gitcobra/anzip/dist/anzip.iife.js

Download or copy and paste the code.
See the test folder on GitHub for details.

Usage

// sample data
var bin = new Uint8Array([0, 1, 2, 3, 127, 255]);
var txt = 'text data';

// 1: create new AnZip object
var azip = new AnZip;

// 2: add the data to an arbitrary path
azip.add('dir1/dir1_1/file1.bin', bin);
azip.add('dir2/text.txt', txt);

// 3: output the zip as Uint8Array
var array = azip.zip();

Methods

add(path [, data])

  • path: string

    • Path to directory or file in the zip. Forward slash('/') and backslash('\') are both allowed for directory separators.
  • data (optional): TypedArray | Array | string | ArrayBuffer | Buffer

    • Data you want to store
  • Return Value: void

  • Construct directories in the zip then add data if specified. Throw an Error when you try to add any data to path already exists.

has(path)

  • path: string

  • Return Value: boolean

  • Check whether the path already exists.

zip()

  • Return Value: Uint8Array
    • May be Array in the old environments such as WSH
  • Output the zip binary as an Uint8Array.

clear()

  • Return Value: void

  • Clear all data.

Extra methods

These are for modern JavaScript engines. Always return null or empty string in old environments.

buffer()

  • Return Value: ArrayBuffer | Buffer

  • Output the zip as an ArrayBuffer or a Buffer.

blob()

  • Return Value: Blob

  • Output as a Blob.

url()

  • Return Value: string

  • Output as an object url.