Use 'bindings' module

This commit is contained in:
Brian M. Carlson 2014-09-18 00:24:13 -04:00
parent 044f394917
commit 60d5ab6abb
2 changed files with 5 additions and 13 deletions

View File

@ -6,16 +6,7 @@ var CopyFromStream = require(__dirname + '/../copystream').CopyFromStream;
var CopyToStream = require(__dirname + '/../copystream').CopyToStream; var CopyToStream = require(__dirname + '/../copystream').CopyToStream;
var JsClient = require(__dirname + '/../client'); // used to import JS escape functions var JsClient = require(__dirname + '/../client'); // used to import JS escape functions
var binding; var binding = require('bindings')('binding.node');
//TODO remove on v1.0.0
try {
//v0.5.x
binding = require(__dirname + '/../../build/Release/binding.node');
} catch(e) {
//v0.4.x
binding = require(__dirname + '/../../build/default/binding');
}
var Connection = binding.Connection; var Connection = binding.Connection;
var NativeQuery = require(__dirname + '/query'); var NativeQuery = require(__dirname + '/query');

View File

@ -18,13 +18,14 @@
"author": "Brian Carlson <brian.m.carlson@gmail.com>", "author": "Brian Carlson <brian.m.carlson@gmail.com>",
"main": "./lib", "main": "./lib",
"dependencies": { "dependencies": {
"generic-pool": "2.1.1", "bindings": "^1.2.1",
"buffer-writer": "1.0.0", "buffer-writer": "1.0.0",
"pgpass": "0.0.3", "generic-pool": "2.1.1",
"nan": "~1.3.0", "nan": "~1.3.0",
"packet-reader": "0.2.0", "packet-reader": "0.2.0",
"pg-connection-string": "0.1.2", "pg-connection-string": "0.1.2",
"pg-types": "1.4.0" "pg-types": "1.4.0",
"pgpass": "0.0.3"
}, },
"devDependencies": { "devDependencies": {
"jshint": "2.5.2", "jshint": "2.5.2",