Querystring

Node.js querystring module — URL query string parsing and formatting. This is the legacy API; prefer URLSearchParams for new code.

Module: node:querystring Support: Experimental Since: 1.1.0 Docs: Node.js Docs See also: https://nodejs.org/api/querystring.html

Static Methods

🟢 parse(str, sep, eq, options)
Parses a URL query string into a key-value object.
🟢 stringify(obj, sep, eq, options)
Serializes an object into a URL query string.
🟢 escape(str)
Percent-encodes a string for use in a query string.
🟢 unescape(str)
Decodes a percent-encoded query string component.
🟢 encode(obj, sep, eq, options)
Alias for stringify(); serializes an object into a query string.
🟢 decode(str, sep, eq, options)
Alias for parse(); parses a query string into a key-value object.

Known Issues

  • Legacy module; URLSearchParams (WHATWG) is preferred for new code