Socket
Socket
Sign inDemoInstall

numcodecs

Package Overview
Dependencies
1
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    numcodecs

Buffer compression and transformation codecs for use in data storage and communication applications.


Version published
Maintainers
1
Created

Readme

Source

numcodecs

Examples:

Some experiments with Node.js 14.1 module exports.

// import entire registry
import { getCodec } from 'numcodecs';
const codec = getCodec({id: 'gzip', level: 1});

// use a dynamic registry, utilizing dynamic imports
import { getCodec } from 'numcodecs/dynamic-registry';
const codec = await getCodec({id: 'gzip', level: 1});

// import individual codecs
import GZip from 'numcodecs/codec/gzip.js';
const codec = new GZip(1);

// Usage
const arr = new Float32Array([1, 2, 3, 4, 5, 6]);
const encoded = codec.encode(new Uint8Array(arr.buffer));
const decoded = coded.decode(encoded);
console.log(new Float32Array(decoded.buffer));
// Float32Array(6) [ 1, 2, 3, 4, 5, 6 ]

Keywords

FAQs

Last updated on 05 May 2020

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