Node.js querystring.unescape() Method Last Updated : 08 Apr, 2021 Comments Improve Suggest changes Like Article Like Report On the specified str, the querystring.unescape() method decodes URL percent-encoded characters. This method converts a percent-encoding string into a normal string. It means it decodes any percent-encoding string into a normal string by removing the % symbol. This method iterates through the string and removes the % encoding where needed on the specified str. The queryString.unescape() function is used by querystring.parse() and is not well known for direct usage. It's being imported mainly to enable program code to have a changeable decoding implementation by assigning queryString.unescape to a different function if necessary. Syntax: querystring.unescape(str); Parameters: This function accepts only one parameter, which is described below. Str: It is the URL percent-encoded characters that are going to be decoded into a normal string. Return value: It returns a normal string after decoding the URL percent-encoded characters. Note: Install querystring using the below command. npm i querystring Below are the following examples to explain the concepts of the query string.unescape function. Example 1: In this example, we are encoding a URL percent-encoded string. Index.js JavaScript //Importing querystring module import querystring from "querystring" // String to be decoded let str = "I%20love%20geeksforgeeks"; // Using the unescape function to decode let decodedURL = querystring.unescape(str); // Printing the decoded url console.log(decodedURL) Run index.js file using below command: node index.js Output: Decoded string: I love geeksforgeeks Example 2: In this example, we are decoding a URL percent-encoded string using querystring.unescape( ) function and decodeURIComponent function and print the output of both the functions. JavaScript //Importing querystring module import querystring from "querystring" // String to be encoded let str = "I%20love%20geeksforgeeks"; // Using the unescape function to the string let decodeURL1 = querystring.unescape(str); let decodeURL2 = decodeURIComponent(str); // Printing the decoded url console.log("Decoded string using unescape: " + decodeURL1) console.log("Decoded string using decodeURIComponent: " + decodeURL2) if(decodeURL2 === decodeURL1) console.log("both strings are equal") Output: Decoded string using unescape: I love geeksforgeeks Decoded string using decodeURIComponent: I love geeksforgeeks both strings are equal Comment More infoAdvertise with us Next Article Node.js querystring.unescape() Method K KapilChhipa Follow Improve Article Tags : Web Technologies Node.js Node.js-Methods Node.js- querystring-Module Similar Reads Node.js querystring.stringify() Method The querystring.stringify() method is used to produce an URL query string from the given object that contains the key-value pairs. The method iterates through the object's own properties to generate the query string. It can serialize a single or an array of strings, numbers, and booleans. Any other 2 min read Node.js querystring.parse() Method The querystring.parse() method is used to parse a URL query string into an object that contains the key and pair values of the query URL. The object returned does not inherit prototypes from the JavaScript object, therefore usual Object methods will not work. During parsing, the UTF-8 encoding forma 3 min read Underscore.js _.toQuery() Method The _.toQuery() method takes an object and converts it into an equivalent URL query string. Syntax: _.toQuery( Object); Parameters: This method accepts a single parameter as mentioned above and described below: Object: This method takes an Object to convert. Return Value: This method returns the equ 1 min read Node.js stringDecoder.end() Method The stringDecoder.end() method is used to return all the remaining input stored in the internal buffer as a string. This method ensures that any incomplete UTF-8 and UTF-16 characters are replaced with substitution characters that are appropriate for character encoding. When the optional buffer argu 2 min read Node.js fs.truncate() Method The fs.truncate() method in node.js is used to change the size of the file i.e either increase or decrease the file size. This method changes the length of the file at the path by len bytes. If len represents a length shorter than the file's current length, the file is truncated to that length. If i 2 min read Node.js urlSearchParams.toString() Method The urlSearchParams.toString() method is an inbuilt application programming interface of class URLSearchParams within url module which is used to get the object of uri search params object as a string. Syntax:  const urlSearchParams.toString() Parameter: This method does not accept any parameter.R 2 min read Node.js stringDecoder.write() Method The stringDecoder.write() method is used to return a decoded string from the given Buffer, TypedArray or DataView. This method also ensures that any incomplete multibyte characters at the end of the buffer are omitted from the returned string. These characters are stored in an internal buffer for th 2 min read Node.js Query String The Query String module used to provides utilities for parsing and formatting URL query strings. It can be used to convert query string into JSON object and vice-versa. Node.js Query StringQuery strings in Node.js are a common way to pass data to a server via a URL. A query string is the part of a U 2 min read Node url.toString() Method The url.toString() method is an inbuilt application programming interface(API) of the URL module within the Node.JS. The url.toString() method is used to return the serialized URL. The returned value is equivalent to that of url.href and url.toJSON(). Syntax: url.toString() Parameters: This method a 1 min read Node.js v8.serialize() Method The v8.serialize() method is an inbuilt application programming interface of the v8 module which is used to serialize any type of data into a buffer using default serializer. Syntax: v8.serialize(value); Parameters: This method one parameter as described below and mentioned above. value: This is a r 2 min read Like