Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including qsman with all npm packages installed. Try it out:

var qsman = require("qsman")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

qsman v0.0.2

query string maintainer

qsman: query string maintainer

NPM version Build Status Coverage Status Known Vulnerabilities changelog license

npm-image

解析和维护(增删改查) URL 上的参数, 拼接 URL 参数的时候再也不用判断是追加 ? 还是 &

Example

import {
    QsMan
} from 'qsman';

var url = new QsMan('https://domain.com?foo=bar').append({
    a: 1,
    b: 2,
    c: '中文'
}).toString();

// https://domain.com?foo=bar&a=1&b=2&c=%E4%B8%AD%E6%96%87
console.log(url);

APIDoc

ESDoc

为什么造轮子

找了很多库都只能一次性解析 query string, 不能方便地维护 query string, 也不能方便地将 query string 再追加到 URL 上

例如

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free