JSPM

shitty-qs

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 761
  • Score
    100M100P100Q99780F
  • License MIT

Shitty query strings parser

Package Exports

  • shitty-qs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (shitty-qs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Shitty query strings parser

Did you ever meet URIError: URI malformed? Nice.

Dedicated to do not fail when decodeURIComponent fails (just return undecoded val).
(and fast) It uses try {} catch (e) {} while decoding tokens.

Usage

var qs = require('shitty-qs');
var q = qs('sid1=t728%F590&sid2=8518224&sid3=LA&sid4=188.19');

// ->

{
    sid1: 't728%F590',
    sid2: '8518224',
    sid3: 'LA',
    sid4: '188.19'
}

Performance

Performance is roughly the same as without try-catch for valid query string

➜  node perf-test.js
shitty-qs normalStuff: 683ms
shitty-qs shittyStuff: 1782ms

qs normalStuff: 1244ms
qs shittyStuff: 2455ms

query-string normalStuff: 742ms
query-string shittyStuff: URIError: URI malformed

FAQ

Q: Is it ready for production?
A: YES!!!

License

MIT