Socket
Socket
Sign inDemoInstall

pg.js

Package Overview
Dependencies
6
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pg.js

node-postgres without the bindings


Version published
Weekly downloads
2.6K
increased by32.91%
Maintainers
1
Install size
223 kB
Created
Weekly downloads
 

Readme

Source

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

FAQs

Last updated on 13 Dec 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc