Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-bzip

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

node-bzip

a pure-javascript Node.JS module for decoding bzip2 data

  • 0.0.1-1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

node-bzip

Not supported, never supported. Take a look at compressjs, which incorporates some part of node-bzip.

node-bzip is a pure-javascript Node.JS module adapted from antimatter15's pure-javascript implementation for decoding bzip2 data. node-bzip currently only decodes buffers into other buffers, synchronously.

How to Install

npm install node-bzip

Usage

After compressing some example data into example.bz2, the following with recreate that original data and save it to example.

var decodeBzip = require('node-bzip');
var fs = require('fs');

var compressedData = fs.readFileSync('example.bz2');
var data = decodeBzip(compressedData);

fs.writeFileSync('example', data);

Documentation

require('node-bzip') returns a function accepting one or two parameters:

function decodeBzip(Buffer inputBuffer, [Number expectedSize])

If expectedSize is not present, decodeBzip simply decodes inputBuffer and returns the resulting Buffer.

If expectedSize is present, decodeBzip will store the results in a Buffer of length expectedSize, and throw an error in the case that the size of the decoded data does not match expectedSize.

Notices

Please note that this module is almost entirely untested and should not be used in a production environment!

License

LGPL 2.1 License

Copyright © 2012 Eli Skeggs

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, see http://www.gnu.org/licenses/lgpl-2.1.html

FAQs

Package last updated on 31 Jan 2015

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