in order to use npm modules in the postgres plv8 procedural language (function), get bundled file and use it directly by coping and pasting.
https://github.com/langateam/node-plv8/blob/master/index.js
git clone https://github.com/JaosnHsieh/bundle-npm-module-into-one-file.git
yarn
or npm install
npm run bundle
npm run test