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

itk-compress-stringify

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

itk-compress-stringify

Zstandard compression and decompression and base64 encoding and decoding in WebAssembly.

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

itk-compress-stringify

npm version

Zstandard compression and decompression and base64 encoding and decoding in WebAssembly.

Example

Documentation

Installation

npm install itk-compress-stringify

Usage

Browser interface

Import:

import {
  compressStringify,
  parseStringDecompress,
  setPipelinesBaseUrl,
  getPipelinesBaseUrl,
  setPipelineWorkerUrl,
  getPipelineWorkerUrl,
} from "itk-compress-stringify"

Functions

compressStringify

Given a binary, compress and optionally base64 encode.

async function compressStringify(
  webWorker: null | Worker,
  input: Uint8Array,
  options: CompressStringifyOptions = {}
) : Promise<CompressStringifyResult>
ParameterTypeDescription
inputUint8ArrayInput binary

CompressStringifyOptions interface:

PropertyTypeDescription
stringifybooleanStringify the output
compressionLevelnumberCompression level, typically 1-9
dataUrlPrefixstringdataURL prefix

CompressStringifyResult interface:

PropertyTypeDescription
webWorkerWorkerWebWorker used for computation
outputUint8ArrayOutput compressed binary
parseStringDecompress

Given a binary or string produced with compressStringify, decompress and optionally base64 decode.

async function parseStringDecompress(
  webWorker: null | Worker,
  input: Uint8Array,
  options: ParseStringDecompressOptions = {}
) : Promise<ParseStringDecompressResult>
ParameterTypeDescription
inputUint8ArrayCompressed input

ParseStringDecompressOptions interface:

PropertyTypeDescription
parseStringbooleanParse the input string before decompression

ParseStringDecompressResult interface:

PropertyTypeDescription
webWorkerWorkerWebWorker used for computation
outputUint8ArrayOutput decompressed binary
setPipelinesBaseUrl

Set base URL for WebAssembly assets when vendored.

function setPipelinesBaseUrl(
  baseUrl: string | URL
) : void
getPipelinesBaseUrl

Get base URL for WebAssembly assets when vendored.

function getPipelinesBaseUrl() : string | URL
setPipelineWorkerUrl

Set base URL for the itk-wasm pipeline worker script when vendored.

function setPipelineWorkerUrl(
  baseUrl: string | URL
) : void
getPipelineWorkerUrl

Get base URL for the itk-wasm pipeline worker script when vendored.

function getPipelineWorkerUrl() : string | URL

Node interface

Import:

import {
  compressStringifyNode,
  parseStringDecompressNode,
} from "itk-compress-stringify"
compressStringifyNode

Given a binary, compress and optionally base64 encode.

async function compressStringifyNode(
  input: Uint8Array,
  options: CompressStringifyOptions = {}
) : Promise<CompressStringifyNodeResult>
ParameterTypeDescription
inputUint8ArrayInput binary

CompressStringifyNodeOptions interface:

PropertyTypeDescription
stringifybooleanStringify the output
compressionLevelnumberCompression level, typically 1-9
dataUrlPrefixstringdataURL prefix

CompressStringifyNodeResult interface:

PropertyTypeDescription
outputUint8ArrayOutput compressed binary
parseStringDecompressNode

Given a binary or string produced with CompressedStringify, decompress and optionally base64 decode.

async function parseStringDecompressNode(
  input: Uint8Array,
  options: ParseStringDecompressOptions = {}
) : Promise<ParseStringDecompressNodeResult>
ParameterTypeDescription
inputUint8ArrayCompressed input

ParseStringDecompressNodeOptions interface:

PropertyTypeDescription
parseStringbooleanParse the input string before decompression

ParseStringDecompressNodeResult interface:

PropertyTypeDescription
outputUint8ArrayOutput decompressed binary

Keywords

FAQs

Package last updated on 24 Jan 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