The NodeJS Querystring module provides methods to deal with query string. It is used to convert query string into JSON object and vice-versa. To include the querystring module, use the require() method:-
var querystring = require('querystring');
The NodeJS Querystring module provides four methods to deal with query string, which includes the below:-
Querystring Method | Description |
---|---|
escape() | It returns an escaped querystring. |
parse() | It parses the querystring and returns an object. |
stringify() | It stringifies an object, and returns a query string. |
unescape() | It returns an unescaped query string. |