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

snappy

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snappy - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

2

lib/snappy.js

@@ -26,3 +26,3 @@ /*

*/
var binding = require('bindings')('binding.node');
var binding = require('bindings')('binding');

@@ -29,0 +29,0 @@ /*

@@ -5,3 +5,3 @@ {

"description": "Nodejs bindings to Google's Snappy compression library",
"version": "1.3.1",
"version": "1.3.2",
"homepage": "https://github.com/kesla/node-snappy",

@@ -8,0 +8,0 @@ "repository": {

@@ -12,13 +12,16 @@ # Node-snappy [![Build Status](https://secure.travis-ci.org/kesla/node-snappy.png)](http://travis-ci.org/kesla/node-snappy)

## Installation
- "npm install snappy"
```
npm install snappy
```
## Examples
### String
```js
var snappy = require('./snappy');
// Use synchronous version
var compressed = snappy.compressSync('string to compress');
var result = snappy.decompressSync(compressed, snappy.parsers.string);
// result will be string instead of Buffer
console.log(result);
var snappy = require('./snappy');
// Use synchronous version
var compressed = snappy.compressSync('string to compress');
var result = snappy.decompressSync(compressed, snappy.parsers.string);
// result will be string instead of Buffer
console.log(result);
```

@@ -28,10 +31,10 @@

```js
var snappy = require('./snappy');
// Snappy automatically convert json to a string
snappy.compress({"foo": "bar"}, function(err, compressed){
snappy.decompress(compressed, snappy.parsers.json, function(err, result){
// result will be json instead of Buffer
console.log(result["foo"]);
}
var snappy = require('./snappy');
// Snappy automatically convert json to a string
snappy.compress({"foo": "bar"}, function(err, compressed){
snappy.decompress(compressed, snappy.parsers.json, function(err, result){
// result will be json instead of Buffer
console.log(result["foo"]);
}
}
```

@@ -62,4 +65,4 @@

# License
Copyright (c) 2011 David Björklund
## License
Copyright (c) 2013 David Björklund

@@ -66,0 +69,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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