You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
巴林闲侠
6f4dcd76d0
|
3 years ago | |
---|---|---|
.. | ||
lib | 3 years ago | |
node_modules/underscore | 3 years ago | |
test | 3 years ago | |
.jshintrc | 3 years ago | |
.travis.yml | 3 years ago | |
LICENSE | 3 years ago | |
README.md | 3 years ago | |
package.json | 3 years ago |
README.md
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" }
...
});