webdickfacecat-qs1
v1.0.0
Published
``` // 以前:JSON内置对象 // JSON.parse() JSON格式 转 对象 // JSON.stringify() 对象 转 JSON格式 // JSON数据格式三大特性:1-长的像对象,2-字符串类型,3-必须双引号 // JSON数据格式: '{"a": 1, "b": 2}'
Downloads
4
Readme
下载
// 以前:JSON内置对象
// JSON.parse() JSON格式 转 对象
// JSON.stringify() 对象 转 JSON格式
// JSON数据格式三大特性:1-长的像对象,2-字符串类型,3-必须双引号
// JSON数据格式: '{"a": 1, "b": 2}'
// 现在:QS模块
// qs.parse() get传递参数格式 转 对象
// qs.stringify() 对象 转 get传递参数格式
// get传递参数格式: '参数名=值&...&参数名=值'
使用
const qs = require("qs");
console.log(qs.parse("a=1&b=2")); // { a: '1', b: '2' }
console.log(qs.stringify({ a: "1", b: "2" })); // a=1&b=2