I am writing a (client-side) JavaScript library (a node/angular module). In this library, I make use of the URLSearchParams class.
const form = new URLSearch         
        
You may use polifill @ungap/url-search-params https://www.npmjs.com/package/@ungap/url-search-params and for webpack may use @ungap/url-search-params/cjs
Old NodeJS 8 (which isused in AWS and GCloud) does not support URLSearchParams so this polifill helps.
In Node 10 when using TypeScript you may enable library dom which includes URLSearchParams implementation. Change tsconfig.json:
{
  "compilerOptions": {
    "lib": [
      ...
      "dom"
      ...
    ]
  }
}