npm.io
2.3.4 • Published 5 years ago

pg-hstore

Licence
MIT
Version
2.3.4
Deps
1
Size
21 kB
Vulns
0
Weekly
0
Stars
107

Build Status

pg-hstore

A node package for serializing and deserializing JSON data to hstore format

Install pg-hstore

$ npm install pg-hstore

Usage

stringify
var hstore = require('pg-hstore')();
var source = { foo: "oof", bar: "rab", baz: "zab" };
hstore.stringify(source, function(result) {
  ...
  // result = '"foo"=>"oof", "bar"=>"rab", "baz"=>"zab"'
  ...
});
parse
var hstore = require('pg-hstore')();
var source = '"foo"=>"oof", "bar"=>"rab", "baz"=>"zab"';
hstore.parse(source, function(result) {
  ...
  // result = { foo: "oof", bar: "rab", baz: "zab" } 
  ...
});