npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

devkits-query-string

v1.0.0

Published

Parse and stringify URL query strings — zero dependencies

Readme

devkits-query-string

Parse and stringify URL query strings. Zero dependencies, lightweight alternative to Node.js querystring.

Install

npm install -g devkits-query-string

npm version

Usage

CLI

# Parse query string to JSON
query-string parse "foo=bar&baz=qux"
# Output: {"foo":"bar","baz":"qux"}

# Stringify object to query string
query-string stringify '{"name":"test","count":5}'
# Output: name=test&count=5

# Extract query from full URL
query-string url "https://example.com/page?foo=bar#hash"
# Output: {"foo":"bar"}

# Handle arrays
query-string parse "tags[]=js&tags[]=node"
# Output: {"tags":["js","node"]}

# URL encoding
query-string parse "name=hello%20world"
# Output: {"name":"hello world"}

Programmatic API

const { parse, stringify, parseUrl } = require('devkits-query-string');

// Parse query string
const obj = parse('foo=bar&baz=qux');
// { foo: 'bar', baz: 'qux' }

// Handle URL-encoded values
parse('name=hello%20world');
// { name: 'hello world' }

// Plus sign as space
parse('q=hello+world');
// { q: 'hello world' }

// Stringify object
const str = stringify({ name: 'test', count: 5 });
// 'name=test&count=5'

// Arrays become []
stringify({ tags: ['js', 'node'] });
// 'tags[]=js&tags[]=node'

// Parse full URL
parseUrl('https://example.com/page?foo=bar#hash');
// { foo: 'bar' }

API

parse(str)

Parse query string into object.

| Param | Type | Description | |-------|------|-------------| | str | string | Query string (with or without ?) | | Returns | Object | Parsed key-value pairs |

stringify(obj)

Stringify object into query string.

| Param | Type | Description | |-------|------|-------------| | obj | Object | Key-value pairs | | Returns | string | Query string (without ?) |

parseUrl(url)

Parse full URL and extract query string.

| Param | Type | Description | |-------|------|-------------| | url | string | Full URL | | Returns | Object | Parsed query parameters |

Features

  • Zero dependencies — Pure JavaScript, no external packages
  • URL decoding — Handles %XX encoding and + as space
  • Array support — Parse foo[]=a&foo[]=b into arrays
  • Duplicate keys — Last value wins (standard behavior)
  • CLI + library — Works as command tool or npm module
  • Lightweight — ~2KB minified

Use Cases

  • URL manipulation — Parse and modify query parameters
  • Form data — Handle URL-encoded form submissions
  • Deep linking — Extract state from URLs
  • API clients — Build query strings programmatically
  • Analytics — Parse tracking parameters from URLs

Examples

// Build pagination params
stringify({ page: 2, limit: 20, sort: 'created' });
// 'page=2&limit=20&sort=created'

// Parse search filters
parse('q=nodejs&category=tools&price_min=10');
// { q: 'nodejs', category: 'tools', price_min: '10' }

// Handle tracking params
parseUrl('https://site.com?utm_source=twitter&utm_medium=social');
// { utm_source: 'twitter', utm_medium: 'social' }

Related Tools

🔍 Build something amazing? Check out API Monitor — simple, affordable API monitoring for indie hackers. Get alerted before your customers notice. Just $9/mo.

See Also

Support

If you find this tool useful, please consider supporting:

Open Collective

Become a sponsor: Open Collective - DevKits

Crypto Donations

  • ETH: 0xDea4a6A20fCB44467e45Ef378972F54B22dC59db
  • USDC: 0xDea4a6A20fCB44467e45Ef378972F54B22dC59db

View Crypto Donation Page

License

MIT — DevKits Team