Tutorials References Exercises Bootcamp Menu
Sign Up Create Website Get Certified Upgrade

Node.js Query String Module

❮ Built-in Modules


Parse a query string into an object, and extract the year property:

var querystring = require('querystring');
var q = querystring.parse('year=2017&month=february');
Run example »

Definition and Usage

The Query String module provides a way of parsing the URL query string.


The syntax for including the Query String module in your application:

var querystring = require('querystring');

Query String Methods

Method Description
escape() Returns an escaped querystring
parse() Parses the querystring and returns an object
stringify() Stringifies an object, and returns a query string
unescape() Returns an unescaped query string

❮ Built-in Modules