Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
awesome-querystring
Advanced tools
Readme
Created out of a frustration with the node default querystring as well as for TypeScript based projects that do not require @types/node
Install with yarn:
$ yarn add awesome-querystring
Create a querystring from a JS object
const { stringify } = require('awesome-querystring');
// or for TypeScript:
// import { stringify } from 'awesome-querystring';
console.log(stringify({prop: 'value', prop2: 'value2'}));
//=> '?prop=value&prop2=value2'
// supply options
console.log(stringify({prop: 'value', prop2: 'value2'}, {separator: '&', equals: '=', includeQuestion: true}));
//=> '?prop=value&prop2=value2'
// customize options
console.log(stringify({prop: 'value', prop2: 'value2'}, {separator: '&&', equals: '=', includeQuestion: false}));
//=> 'prop=value&&prop2=value2'
Create a JS object from a querystring
const { parse } = require('awesome-querystring');
// or for TypeScript:
// import { parse } from 'awesome-querystring';
console.log(parse('?prop=value&prop2=value2'));
//=> {prop: 'value', prop2: 'value2'}
// supply options
console.log(parse('?prop=value&prop2=value2', {separator: '&', equals: '='}));
//=> {prop: 'value', prop2: 'value2'}
// customize options
console.log(parse('prop=value&&prop2=value2', {separator: '&&', equals: '='}));
//=> {prop: 'value', prop2: 'value2'}
string
Stringifies an object
IAwesomeQuerystringObject
Parses a querystring back to an object
IStringifyOptions
Options for the Stringify function
IParseOptions
Options for the Parse function
string
Stringifies an object
Kind: global function
Param | Type | Description |
---|---|---|
obj | IAwesomeQuerystringObject | Object to stringify |
[options] | IStringifyOptions | Options for the stringify, see IStringifyOptions |
IAwesomeQuerystringObject
Parses a querystring back to an object
Kind: global function
Param | Type | Description |
---|---|---|
qs | string | Querystring to parse |
[options] | IParseOptions | Options for the parse, see IParseOptions |
IStringifyOptions
Options for the Stringify function
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
separator | string | separator the querystring should get |
equals | string | equals sign the querystring should use |
includeQuestion | boolean | whether the querystring should be prefixed with a |
IParseOptions
Options for the Parse function
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
separator | string | separator the querystring has |
equals | string | equals sign the querystring has |
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Copyright © 2018-2019, Favna. Released under the MIT License.
This project is open source and always will be, even if I don't get donations. That said, I know there are people out there that may still want to donate just to show their appreciation so this is for you guys. Thanks in advance!
I accept donations through PayPal, BitCoin, Ethereum and LiteCoin. You can use the buttons below to donate through your method of choice
Donate With | QR | Address |
---|---|---|
Donate with PayPal | ||
1E643TNif2MTh75rugepmXuq35Tck4TnE5 | ||
0xF653F666903cd8739030D2721bF01095896F5D6E | ||
LZHvBkaJqKJRa8N7Dyu41Jd1PDBAofCik6 |
FAQs
Awesome and robust querystring
The npm package awesome-querystring receives a total of 7 weekly downloads. As such, awesome-querystring popularity was classified as not popular.
We found that awesome-querystring demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.