This repository is no longer maintained as of 3/26/2024.
A pg
alias for pg.js.
The fantastic pg package bundles both native and pure JavaScript bindings for PostgreSQL. This means you have to compile the native bindings, whether you want them or not.
To compensate, pg.js bundles only the JavaScript bindings. This is
great until you use a library like Knex, which is hard-coded to import a
library called pg
.
So this package aliases pg
to pg.js
to trick Knex into importing the right
package.
node-pg exports whatever version of pg.js you depend on in your
package.json
.
If you forget to depend on pg.js yourself, node-pg will blow up when you try to
require
it.
{
"dependencies": {
"pg": "git+https://github.com/WhoopInc/node-pg-pure-alias.git#1.0.0",
"pg.js": "x.x.x",
"..."
}
}
var pg = require("pg");
// `pg` is now vx.x.x of the pg.js package. No native bindings! Shh!
We're shadowing the official NPM 'pg' package!
If you're concerned about depending on this GitHub repository, fork this repository and host the package under your own namespace.