switch node-postges library to a pure js implementation