Coder Social home page Coder Social logo

deprecated-node-zlib's Introduction

DO NOT USE – DEPRECATED

This extension is deprecated since the functionality was folded into node.js core: https://nodejs.org/dist/latest/docs/api/zlib.html

NAME

node-zlib - Simple, synchronous deflate/inflate for node.js buffers.

USAGE

Install with npm install zlib.

var Buffer = require('buffer').Buffer;
var zlib = require('zlib');

var input = new Buffer('lorem ipsum dolor sit amet');
var compressed = zlib.deflate(input);
var output = zlib.inflate(compressed);

Note that node-zlib is only intended for small (< 128 KB) data that you already have buffered. It is not meant for input/output streams.

BUILDING

Make sure you have zlib installed. Mac OS X ships with it by default.

To obtain and build the bindings:

git clone git://github.com/kkaefer/node-zlib.git
cd node-zlib
./configure
make

You can also use npm to download and install them:

npm install zlib

TESTS

expresso is required to run unit tests.

npm install expresso
make test

CONTRIBUTORS

LICENSE

node-zlib is BSD licensed.

deprecated-node-zlib's People

Contributors

kkaefer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

deprecated-node-zlib's Issues

Fix for Build Issue with Webpack

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/zlib/lib/zlib.js b/node_modules/zlib/lib/zlib.js
index bc49811..3979e92 100644
--- a/node_modules/zlib/lib/zlib.js
+++ b/node_modules/zlib/lib/zlib.js
@@ -1 +1 @@
-module.exports = require('./zlib_bindings');
+module.exports = require('zlib');

This issue body was partially generated by patch-package.

Rename npm package

Because Node 0.6 will have built in zlib support, calling require("zlib") to load this module no longer works since the built in version overrides the npm package. I use this module as a dependency to one of my own modules and will continue to do so for a little while yet for backwards compatibility reasons. However, my module is currently broken because because of the naming conflict with the built in version in 0.6 which uses a different API. It might be a good idea to rename this npm module to avoid this naming conflict. Thanks!

Error: [email protected] preinstall: `node-waf clean || true; node-waf configure build`

I am getting error while installing anything using npm.

21783 verbose stack Error: [email protected] preinstall: node-waf clean || true; node-waf configure build
21783 verbose stack spawn ENOENT
21783 verbose stack at ChildProcess. (/usr/local/Cellar/node@6/6.16.0/lib/node_modules/npm/lib/utils/spawn.js:33:16)
21783 verbose stack at emitTwo (events.js:106:13)
21783 verbose stack at ChildProcess.emit (events.js:191:7)
21783 verbose stack at maybeClose (internal/child_process.js:920:16)
21783 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
21784 verbose pkgid [email protected]

Publish 1.0.4 to npm

The latest version on GitHub is 1.0.4 but the latest in NPM is 1.0.2. Can you hit publish on 1.0.4?

Deprecation

Why is this deprecated? The node.js built in is async only...

unable to install zlib on RHEL 6

Hi Konstantin,

I was unable to install zlib on on my RHEL environment. Console output from running 'npm install zlib' as root user is below:

[root@dhcppc36 node]# npm install zlib
npm http GET https://registry.npmjs.org/zlib
npm http 304 https://registry.npmjs.org/zlib
    [email protected] install /usr/lib/node_modules/zlib
    node-waf clean ; node-waf configure build
Nothing to clean (project not configured)
Setting srcdir to : /usr/lib/node_modules/zlib
Setting blddir to : /usr/lib/node_modules/zlib/build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : ok /usr/lib/node/
Checking for node prefix : ok /usr
Checking for library z : yes
'configure' finished successfully (0.096s)
Waf: Entering directory `/usr/lib/node_modules/zlib/build'
[1/2] cxx: src/node-zlib.cc -> build/Release/src/node-zlib_1.o
../src/node-zlib.cc:1:16: error: v8.h: No such file or directory
../src/node-zlib.cc:2:18: error: node.h: No such file or directory
../src/node-zlib.cc:3:25: error: node_buffer.h: No such file or directory
../src/node-zlib.cc:4:26: error: node_version.h: No such file or directory
../src/node-zlib.cc:14:26: error: missing binary operator before token "("
../src/node-zlib.cc:10: error: âv8â is not a namespace-name
../src/node-zlib.cc:10: error: expected namespace-name before â;â token
../src/node-zlib.cc:11: error: ânodeâ is not a namespace-name
../src/node-zlib.cc:11: error: expected namespace-name before â;â token
../src/node-zlib.cc:19: error: âBuffer_Dataâ declared as an âinlineâ variable
../src/node-zlib.cc:19: error: âHandleâ was not declared in this scope
../src/node-zlib.cc:19: error: âObjectâ was not declared in this scope
../src/node-zlib.cc:19: error: âobjâ was not declared in this scope
../src/node-zlib.cc:19: error: expected â,â or â;â before â{â token
../src/node-zlib.cc:22: error: âBuffer_Lengthâ declared as an âinlineâ variable
../src/node-zlib.cc:22: error: âHandleâ was not declared in this scope
../src/node-zlib.cc:22: error: âObjectâ was not declared in this scope
../src/node-zlib.cc:22: error: âobjâ was not declared in this scope
../src/node-zlib.cc:22: error: expected â,â or â;â before â{â token
../src/node-zlib.cc:25: error: expected initializer before â*â token
../src/node-zlib.cc:36: error: expected initializer before â<â token
../src/node-zlib.cc:82: error: expected constructor, destructor, or type conversion before â<âtoken
Waf: Leaving directory `/usr/lib/node_modules/zlib/build'
Build failed: -> task failed (err #1):
    {task: cxx node-zlib.cc -> node-zlib_1.o}
npm ERR! [email protected] install: node-waf clean ; node-waf configure build
npm ERR! sh "-c" "node-waf clean ; node-waf configure build" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the zlib package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf clean ; node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls zlib
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.32-71.el6.i686
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "zlib"
npm ERR! cwd /usr/lib/node
npm ERR! node -v v0.8.18
npm ERR! npm -v 1.2.2
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/lib/node/npm-debug.log
npm ERR! not ok code 0

I looked forward to your response.

Thanks.

node-waf: command not found

Hello, installing

npm install zlib

I have error

~/work/kuku/app • npm install zlib --save                          19:40  dima@Dmitrys-MacBook-Pro
-
> [email protected] preinstall /Users/dima/work/kuku/app/node_modules/zlib
> node-waf clean || true; node-waf configure build

sh: node-waf: command not found
sh: node-waf: command not found
npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "zlib" "--save"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the [email protected] preinstall script 'node-waf clean || true; node-waf configure build'.
npm ERR! This is most likely a problem with the zlib package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls zlib
npm ERR! There is likely additional logging output above.

OSx

Doesn't work after exception

var zlib = require('zlib');
var Buffer = require('buffer').Buffer;

var badData = new Buffer("not compressed content");
var compressed = zlib.deflate(new Buffer("some data"));
try {
zlib.inflate(badData);
} catch (e) {
console.log('Expected error: %s', e.message);
}
try {
zlib.inflate(compressed);
} catch (e) {
console.log('Unexpected error: %s', e.message);
}

Incorrect directory in wscript for node 0.6

Just tried using zlib bindings and found that the path in the wscript is no longer correct for 0.6. What are your thoughts on this? Easy fix for 0.6, but will most likely break backwards compat. Since its just Python wouldn't be hard to write a quick few lines to iterate over the possible dirs and locate a match.

Can't install in Windows 7 (enterprise)

npm ERR! [email protected] preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! spawn Unknown system errno 203
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the zlib package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls zlib
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\MyPrograms\\nodejs\\node.exe" "C:\\MyPrograms\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\xxxxxxxxxx\workspace\yyyyyyyyy\src\main\server
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! syscall spawn
npm ERR! code ELIFECYCLE
npm ERR! errno Unknown system errno 203
npm

streaming support

Hello,

It would be nice if node-zlib could operate on streams and inflate/deflate on the fly.

Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.