New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@types/yauzl-promise

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/yauzl-promise

TypeScript definitions for yauzl-promise

  • 2.1.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Installation

npm install --save @types/yauzl-promise

Summary

This package contains type definitions for yauzl-promise (https://github.com/overlookmotel/yauzl-promise).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yauzl-promise.

index.d.ts

// TypeScript Version: 2.1

/// <reference types="node" />

import { EventEmitter } from "events";
import { Readable } from "stream";
import { Entry as BaseEntry, Options, RandomAccessReader, ZipFileOptions } from "yauzl";

// This class is not directly compatible with @types/yauzl 's ZipFile as this library changes the function signatures
// Therefore, it is replaced, albeit with a significant portion
export class ZipFile extends EventEmitter {
    // This chunk taken directly from @types/yauzl
    autoClose: boolean;
    comment: string;
    decodeStrings: boolean;
    emittedError: boolean;
    entriesRead: number;
    entryCount: number;
    fileSize: number;
    isOpen: boolean;
    lazyEntries: boolean;
    readEntryCursor: boolean;
    validateEntrySizes: boolean;

    constructor(
        reader: RandomAccessReader,
        centralDirectoryOffset: number,
        fileSize: number,
        entryCount: number,
        comment: string,
        autoClose: boolean,
        lazyEntries: boolean,
        decodeStrings: boolean,
        validateEntrySizes: boolean,
    );

    // These funcitons are custom to yauzl-promise

    close(): Promise<void>;
    readEntry(): Promise<Entry>;
    readEntries(numEntries?: number): Promise<Entry[]>;
    walkEntries(callback: (entry: Entry) => Promise<void> | void, numEntries?: number): Promise<void>;
    openReadStream(entry: Entry, options?: ZipFileOptions): Promise<Readable>;
}

export class Entry extends BaseEntry {
    openReadStream(options?: ZipFileOptions): Promise<Readable>;
}

export function open(path: string, options?: Options): Promise<ZipFile>;
// export function open(path: string): Promise<ZipFile>;
export function fromFd(fd: number, options?: Options): Promise<ZipFile>;
// export function fromFd(fd: number): Promise<ZipFile>;
export function fromBuffer(buffer: Buffer, options?: Options): Promise<ZipFile>;
// export function fromBuffer(buffer: Buffer): Promise<ZipFile>;
export function fromRandomAccessReader(
    reader: RandomAccessReader,
    totalSize: number,
    options?: Options,
): Promise<ZipFile>;
// export function fromRandomAccessReader(reader: RandomAccessReader, totalSize: number): Promise<ZipFile>;

// These are copied directly from @types/yauzl, I beleive they are unmodified
export function dosDateTimeToDate(date: number, time: number): Date;
export function validateFileName(fileName: string): string | null;

export { Options, RandomAccessReader, ZipFileOptions };

Additional Details

  • Last updated: Wed, 18 Oct 2023 18:04:04 GMT
  • Dependencies: @types/node, @types/yauzl

Credits

These definitions were written by .

FAQs

Package last updated on 18 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc