Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Merge Query Strings (Node.js)
const url = require('url')
const appendQueryString = (url_string, query_string_object) => {
const parsed_url = url.parse(url_string, true);
parsed_url.query = Object.assign(
parsed_url.query,
query_string_object,
);
return url.format(parsed_url);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.