New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

armarius-io

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

armarius-io

IO and compression library for Armarius

latest
Source
npmnpm
Version
1.2.5
Version published
Maintainers
2
Created
Source

armarius-io

About

This module contains implementations for reading from and writing to files, as well as implementations for deflate compression using various JavaScript APIs. It is mainly used by the armarius module.

Contained are IO contexts for Blob object (read only), ArrayBuffers, and Node.js FileHandle objects. Compression contexts exist for the CompressionStreams API, the Node.js zlib module, and the fflate library.

Installation

Armarius-IO can be installed using npm:

npm install armarius-io

Usage

IO contexts

IO contexts are objects that extend the IO class and can be used to read from or write to an underlying file or buffer. This library contains the following IO contexts:

  • ArrayBufferIO - for reading from and writing to an ArrayBuffer
  • BlobIO - for reading from a Blob or JavaScript File object
  • NodeFileIO - for reading from and writing to a Node.js FileHandle object

ArrayBufferIO

let data = new Uint8Array(123);
let io = new ArrayBufferIO(data.buffer, data.byteOffset, data.byteLength);

BlobIO

let file = input.files[0];
let io = new BlobIO(file);

NodeFileIO

let file = await fs.promises.open('file.txt', 'r+');
let stat = await file.stat();
let io = new NodeFileIO(file, 0, stat.size);

DataStreams

DataStream objects can be used to read data from a source. All IO contexts also implement DataStream.

DataProcessors

DataProcessor objects read and transform data from a DataStream. This library includes DataProcessors for deflate compression using various JavaScript APIs.

  • NativeDeflateDataProcessor and NativeInflateDataProcessor - for using the CompressionStreams API
  • NodeDeflateDataProcessor and NodeInflateDataProcessor - for using the Node.js zlib module
  • FflateDeflateDataProcessor and FflateInflateDataProcessor - for using the fflate library
  • DefaultDeflateDataProcessor and DefaultInflateDataProcessor - for using the best available compression method

FAQs

Package last updated on 09 Jul 2024

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