Node.js v18.12.1 documentation


Table of contents

Query string查询字符串#

Stability: 2 - Stable

Source Code: lib/querystring.js

The node:querystring module provides utilities for parsing and formatting URL query strings. node:querystring模块提供了用于解析和格式化URL查询字符串的实用程序。It can be accessed using:可通过以下方式访问:

const querystring = require('node:querystring');

querystring is more performant than <URLSearchParams> but is not a standardized API. querystring<URLSearchParams>性能更好,但不是标准化的API。Use <URLSearchParams> when performance is not critical or when compatibility with browser code is desirable.当性能不重要或需要与浏览器代码兼容时,请使用<URLSearchParams>