const url = new URL('http://www.google.co.uk?lang=en&q=foo') console.log(url.searchParams); // Result { lang: 'en', q: 'foo' }