browserify / browserify-zlib Goto Github PK
View Code? Open in Web Editor NEWFull zlib module for browserify
License: Other
Full zlib module for browserify
License: Other
What is the reason of broken tests in IE6-8 ? Can't find anything specific in your code. Pako is also ok.
Probably, you need to add es5-shim in your testing env, to have all output matrix green.
Hello,
Is the lib supported in Angular 6 because I am observing issues?
Steps to reproduce the issue
zlib.deflate(text, cb);
Actual behavior (issues):
I've been working on a compression library fflate for the past few months. It performs quite a bit better than Pako in most circumstances for both compression and decompression of DEFLATE, implements GZIP and Zlib wrappers, and supports offloading processing to a separate Worker thread to avoid blocking. This should allow for much more similar functionality to the Node.js module.
Although the binary output for the compression methods is often vastly different from true Zlib with fflate, this shouldn't really matter, since the output is still valid and works fine. In some cases, the output is larger at the same level, but always by under 5%, and in exchange performance can increase by up to 50%. In addition, the API is completely different to that of Pako and Zlib, so this package may require a major rewrite.
Overall, browserify-zlib
can weigh less, achieve higher performance, and, in some cases, act more similarly to true Node.js package (i.e. not blocking with the callback variant) using this implementation. If the maintainers are interested, I can submit a PR with the changes.
P.S. It may be of interest to update the package to use Pako 2.0 even if fflate won't work here.
/cc @browserify
Makes VS.NodejsTools parser crash;
---> (Inner Exception #0) Microsoft.NodejsTools.Npm.PackageJsonException: Error reading package.json at 'C:\myproject\node_modules\browserify-zlib\package.json': Error reading package.json. The file may be parseable JSON but may contain objects with duplicate properties.
I suppose the second one is the good one: "main": "src/index.js",
{
"name": "browserify-zlib",
"version": "0.1.4",
"description": "Full zlib module for browserify",
"keywords": ["zlib", "browserify"],
"main": "index.js", // duplicate key #1 here
"directories": {
"test": "test"
},
"dependencies": {
"pako": "~0.2.0"
},
"devDependencies": {
"tape": "^2.12.3",
"brfs": "^1.0.1"
},
"testling": {
"files": "test/*.js",
"browsers": [
"ie/6..latest",
"chrome/22..latest",
"firefox/16..latest",
"safari/latest",
"opera/11.0..latest",
"iphone/6",
"ipad/6",
"android-browser/latest"
]
},
"scripts": {
"test": "node_modules/tape/bin/tape test/*.js"
},
"main": "src/index.js", // duplicate key #2 here
"author": "Devon Govett <[email protected]>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/devongovett/browserify-zlib.git"
}
}
Thanks for the support
test/disabled-test-zlib-from-gzip-with-trailing-garbage.js
seems to test trailing garbage, but is disabled
I am getting this error
ERROR in ../node_modules/zlib/lib/zlib.js 1:0-43
Module not found: Error: Can't resolve './zlib_bindings' in 'C:\My Desktop\TRY_MERNG_ISSUE\node_modules\zlib\lib'
Whenever i call sync methods which use zlibBufferSync()
, I get:
# zlib (zlibBufferSync) elipses.txt 16384 {"level":6,"windowBits":15,"memLevel":8,"strategy":0} DeflateRaw -> InflateRaw
not ok 82 Error: buffer error:
---
operator: error
expected: undefined
actual: { [Error: buffer error: ] errno: -5, code: 'Z_BUF_ERROR' }
stack:
Error: buffer error:
at Zlib._binding.onerror (/Users/stephg/Development/checkpad/browserify-zlib/src/index.js:364:17)
at Zlib._error (/Users/stephg/Development/checkpad/browserify-zlib/src/binding.js:229:8)
at Zlib._write (/Users/stephg/Development/checkpad/browserify-zlib/src/binding.js:187:10)
at Zlib.writeSync (/Users/stephg/Development/checkpad/browserify-zlib/src/binding.js:136:15)
at InflateRaw.Zlib._processChunk (/Users/stephg/Development/checkpad/browserify-zlib/src/index.js:520:31)
at Object.zlibBufferSync (/Users/stephg/Development/checkpad/browserify-zlib/src/index.js:235:17)
at Test.<anonymous> (/Users/stephg/Development/checkpad/browserify-zlib/test/test-zlib.js:218:37)
at Test.bound [as _cb] (/Users/stephg/Development/checkpad/browserify-zlib/node_modules/tape/lib/test.js:60:32)
at Test.run (/Users/stephg/Development/checkpad/browserify-zlib/node_modules/tape/lib/test.js:74:14)
at Test.bound [as run] (/Users/stephg/Development/checkpad/browserify-zlib/node_modules/tape/lib/test.js:60:32)
...
This is the test:
factisresearch@734fbab
Hi!
Would you mind re-uploading a correct package.json for the package version 0.1.4? It breaks our parsers as it contains two "main" entries.
Thank you.
-l
The zlib module's new (11.7+) brotli methods are not supported. Docs here: https://nodejs.org/api/zlib.html#zlib_class_zlib_brotlicompress.
Presumably this is because Pako doesn't support them? It'd be good to list this in the readme though.
Notably it is possible to at least decode brotli on the web using https://www.npmjs.com/package/brotli. The encode part of that package only works in node though.
Hi,
Debian project want in order to harden secrurity to use only pako >= 2
Could be possible to port ?
Hello,
I'm trying to serialize a large amount of JSON for a one-file web report that I want to be able to generate from within Python but have the browser decompress on the fly. I wanted to test a simple example first though but I keep getting following error:
Error: data error: incorrect header
checkcode: "Z_DATA_ERROR"
errno: -3
message: "data error: incorrect header check"
I will refer to the files in this gist as a minimal example.
https://gist.github.com/mobiusklein/8945d55b9b0f86f2bceb
I wrote a simple gzip file builder in Python, compress.py
. It generates a small file data.json.gz that is gzipped json data. To test that it can be decompressed, I wrote decompress.js
, which uses the built-in Node bindings for zlib. It is able to decompress the file generated by Python.
I wrote prog.js, and prepare it for the web with browserify prog.js -o main.js
, which I load in index.html
. I run a SimpleHTTPServer to serve the html file and data.json.gz and the ajax request from index.html
pulls in the compressed data successfully, but throws the above error when attempting to decompress.
Next, to make sure it's not something Python is leaving out, I wrote compress.js
, which does the same thing, but in JavaScript again. The generated compressed file looks different, but still decompresses correctly with decompress.js
. When I try to load it in the browser, I still get the same error.
I'm using Browserify 6.3.2 with Node v0.10.22, in Chrome 38. Any ideas what I should be doing differently?
It would be nice to have some installation instructions for this. I have no idea what to do with the code. Am I supposed to run browserify on it?
I'm getting this error trying to unzip files in the browser. The files unzip without error in Node. I attempted this on several zip files, got same error. Any hints?
Hi @devongovett! Wondering what are your plans about this library, is it one of your current priorities? Would you be interested in help to maintain it?
Some files created with bgzip
cannot be decompressed, or at least not with the same options as node's native zlib
.
I'm trying to do zlib.gunzip
and I get {errno: -5, code: "Z_BUF_ERROR", stack: (...), message: "buffer error: "}
Here's the code I have
var zlib = require('browserify-zlib')
var drop = require('buffer-drop')
drop(function(err, data) {
zlib.gunzip(data, function(err, buffer) {
console.log(err, buffer)
});
})
Any ideas what's wrong? I can do require('browserify-zlib').gunzip(fs.readFileSync('./file.dat'))
in node w/ the same file and it works as expected
ZStream
properties were renamed nodeca/pako@8bea748#diff-141d824489605d5e800aa76a4112754fL4
I'm having problem with old Node versions and this package, should not be included readable-stream
package as dependency?
Trying to get the unit tests running on my machine, the karma tests are failing for me on master, output is attached. Any ideas how to get the tests running?
Test output:
For example, this code is fine with node:
zlib.inflateSync(arr);
But with browserify-zlib we get TypeError: not a string or buffer
and we must write instead:
zlib.inflateSync(Buffer.from(arr))
https://travis-ci.org/rbuels/browserify-zlib/jobs/423207837 is a travis build of the tip of master (8b3f0a8) that I triggered in my fork. Build's failing with a similar problem to what see on my machine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.