Search code examples
node.jsnode-postgres

How to import pg-types using ES6 syntax?


Could you provide an example for node-pg-types with the "import" statement and not "require" so that type translators get registered for node-postgres?


Solution

  • As it turns out it can be done as (from github):

    import { builtins, getTypeParser } from 'pg-types'