From 4c00781ed49b12f42fc2bc96958ffd4efeb39252 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 1 Jun 2018 09:33:34 +0200 Subject: [PATCH] drop safe-buffer dependency, bump min node to 6 - fixes #20 --- .travis.yml | 5 ++--- index.js | 1 - package.json | 5 ++--- test.js | 5 ++--- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index ecc4978..fc15089 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: node_js node_js: - - "8" - - "6" - - "4" + - node + - lts/* diff --git a/index.js b/index.js index 17185d5..5a56753 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,6 @@ const rcodes = require('./rcodes') const opcodes = require('./opcodes') const classes = require('./classes') const ip = require('ip') -const Buffer = require('safe-buffer').Buffer const QUERY_FLAG = 0 const RESPONSE_FLAG = 1 << 15 diff --git a/package.json b/package.json index 107c9ed..578e9d2 100644 --- a/package.json +++ b/package.json @@ -7,14 +7,13 @@ "repository": "mafintosh/dns-packet", "homepage": "https://github.com/mafintosh/dns-packet", "engines": { - "node": ">=4" + "node": ">=6" }, "scripts": { "test": "eslint --color *.js && tape test.js" }, "dependencies": { - "ip": "^1.1.5", - "safe-buffer": "^5.1.1" + "ip": "^1.1.5" }, "devDependencies": { "eslint": "^4.19.1", diff --git a/test.js b/test.js index 9c27d77..780dd12 100644 --- a/test.js +++ b/test.js @@ -4,7 +4,6 @@ const tape = require('tape') const packet = require('./') const rcodes = require('./rcodes') const opcodes = require('./opcodes') -const Buffer = require('safe-buffer').Buffer tape('unknown', function (t) { testEncoder(t, packet.unknown, Buffer.from('hello world')) @@ -417,8 +416,8 @@ tape('nsec3', function (t) { algorithm: 1, flags: 0, iterations: 257, - salt: new Buffer([42, 42, 42]), - nextDomain: new Buffer([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]), + salt: Buffer.from([42, 42, 42]), + nextDomain: Buffer.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]), rrtypes: ['A', 'DNSKEY', 'CAA', 'DLV'] }) t.end()