JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3135
  • Score
    100M100P100Q115530F
  • License MIT

node-postgres without the bindings

Package Exports

  • pg.js
  • pg.js/lib/types

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pg.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-postgres-pure

The exact same node-postgres module without any of the C/C++ stuff. If you're just using the pure JavaScript bindings, there's really no reason to wait for the native stuff to compile.

install

npm install pg.js

use

//exact same code, you can just change the string
//in your requires from pg to pg.js and you're done
var pg = require('pg.js')

pg.connect(function(err, client, release) {
  if (err) throw err;
  client.query('SELECT NOW()', function(err, res) {
    release()
    if (err) throw err;
    console.log(res.rows[0])
  })
})

how it works

I pull in the node-postgres repo and delete the /src folder and the .gyp file.

Then I publish the same code to npm as pg.js. So easy.

license

MIT