@muyi086/qs
v1.0.4
Published
Implementing qs.Stringify and qs.Parse in native JavaScript
Downloads
3
Maintainers
Readme
qs
Install
npm install @muyi086/qs
# common JS
const { qs } = require('@muyi086/qs')
# es6
import { qs } from '@muyi086/qs'
Use
const queryObj = {
runEnv: 'mp-weixin',
shopTabType: 0,
hasLocation: true,
longitude: 120.209885,
latitude: 30.246592,
vConsole: 0
}
console.log(qs.stringify(queryObj))
const url = '?runEnv=mp-weixin&shopTabType=0&hasLocation=true&longitude=120.209885&latitude=30.246592&vConsole=0'
console.log(qs.parse(url))