Socket
Socket
Sign inDemoInstall

@types/pako

Package Overview
Dependencies
0
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/pako

TypeScript definitions for pako


Version published
Weekly downloads
1.2M
decreased by-8.53%
Maintainers
1
Created
Weekly downloads
 

Package description

What is @types/pako?

@types/pako provides TypeScript type definitions for the pako library, which is a fast and efficient zlib port to JavaScript, primarily used for data compression and decompression.

What are @types/pako's main functionalities?

Compression

This feature allows you to compress a string using the deflate algorithm. The code sample demonstrates how to compress a simple string and output the compressed result.

const pako = require('pako');
const input = 'Hello, world!';
const compressed = pako.deflate(input, { to: 'string' });
console.log(compressed);

Decompression

This feature allows you to decompress a previously compressed string using the inflate algorithm. The code sample shows how to decompress a base64 encoded compressed string and output the original string.

const pako = require('pako');
const compressed = 'eJzT0yMAAGTvBe8=';
const decompressed = pako.inflate(compressed, { to: 'string' });
console.log(decompressed);

Gzip Compression

This feature allows you to compress a string using the gzip algorithm. The code sample demonstrates how to gzip compress a simple string and output the compressed result.

const pako = require('pako');
const input = 'Hello, world!';
const compressed = pako.gzip(input, { to: 'string' });
console.log(compressed);

Gzip Decompression

This feature allows you to decompress a previously gzip compressed string using the ungzip algorithm. The code sample shows how to ungzip decompress a base64 encoded compressed string and output the original string.

const pako = require('pako');
const compressed = 'H4sIAAAAAAAAE8tIzcnJVyjPL8pJAQCFE0oNCwAAAA==';
const decompressed = pako.ungzip(compressed, { to: 'string' });
console.log(decompressed);

Other packages similar to @types/pako

Readme

Source

Installation

npm install --save @types/pako

Summary

This package contains type definitions for pako (https://github.com/nodeca/pako).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pako.

Additional Details

  • Last updated: Sun, 24 Sep 2023 06:37:27 GMT
  • Dependencies: none
  • Global values: pako

Credits

These definitions were written by Caleb Eggensperger, Muhammet Öztürk, and Thibault Poisson.

FAQs

Last updated on 24 Sep 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc