Skip to content

Commit

Permalink
remove buffertools dependency
Browse files Browse the repository at this point in the history
nginxparser only use buffertool to concat buffers, which is doable with
the native `Buffer` class since v0.7.11. Removing buffertools make the
installation easier and quicker (no need to compile buffertools)
  • Loading branch information
jgoyon committed Apr 11, 2017
1 parent 1e84457 commit 9a0e87a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 2 additions & 3 deletions index.js
@@ -1,6 +1,5 @@
var fs = require('fs')
, spawn = require('child_process').spawn
, buffertools = require('buffertools');
, spawn = require('child_process').spawn;

/**
* Create a log parser.
Expand Down Expand Up @@ -95,7 +94,7 @@ Parser.prototype.stdin = function (iterator, callback) {
Parser.prototype.stream = function (stream, iterator, callback) {
var self = this, overflow = new Buffer(0), complete = false;
stream.on('data', function (data) {
var buffer = buffertools.concat(overflow, data), newline = 0;
var buffer = Buffer.concat(overflow, data), newline = 0;
for (var i = 0, len = buffer.length; i < len; i++) {
if (buffer[i] === 10) {
self.parseLine(buffer.slice(newline, i), iterator);
Expand Down
5 changes: 1 addition & 4 deletions package.json
Expand Up @@ -11,10 +11,7 @@
"type": "git",
"url": "http://github.com/chriso/nginx-parser.git"
},
"engines": { "node": ">=0.4.0" },
"dependencies": {
"buffertools": "2.1.3"
},
"engines": { "node": ">=0.7.11" },
"licenses": [{
"type": "MIT",
"url": "http://github.com/chriso/nginx-parser/raw/master/LICENSE"
Expand Down

0 comments on commit 9a0e87a

Please sign in to comment.