$ cnpm install postgres-array
Parse postgres array columns
npm install --save postgres-array
const { parse } = require('postgres-array')
parse('{1,2,3}', (value) => parseInt(value, 10))
//=> [1, 2, 3]
parse(input, [transform]) -> arrayRequired
Type: string
A Postgres array string.
Type: function
Default: identity
A function that transforms non-null values inserted into the array.
MIT © Ben Drucker
Copyright 2013 - present © cnpmjs.org | Home |