
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
smart-query-string
Advanced tools
A lightweight TypeScript utility for parsing and manipulating query strings — no dependencies.
A lightweight, zero-dependency TypeScript utility for parsing and manipulating URL query strings. This package provides a simple and type-safe API for working with URL query parameters in both browser and Node.js environments.
npm install smart-query-string
yarn add smart-query-string
pnpm add smart-query-string
Framework Agnostic This package is designed to work seamlessly with any JavaScript framework including React, Vue, Angular, Svelte, and more. It has no framework dependencies and can be used in any JavaScript or TypeScript project.
import {queryString} from 'smart-query-string';
// Get all current URL query parameters as an object
const currentParams = queryString.get();
// If URL is https://example.com?page=1&sort=name
// Returns: { page: '1', sort: 'name' }
import {queryString} from 'smart-query-string';
// Set query parameters (replaces all existing ones)
queryString.set({page: 2, sort: 'name'});
// Updates URL to: https://example.com?page=2&sort=name
import {queryString} from 'smart-query-string';
// Update specific parameters while preserving others
queryString.update({page: 3});
// If current URL is https://example.com?page=2&sort=name
// Updates to: https://example.com?page=3&sort=name
import {queryString} from 'smart-query-string';
// Remove all query parameters from the URL
queryString.remove();
// Updates URL to: https://example.com
import {queryString} from 'smart-query-string';
// Remove specific query parameters
queryString.removeKeys(['sort', 'filter']);
// If current URL is https://example.com?page=1&sort=name&filter=active
// Updates to: https://example.com?page=1
import {queryString} from 'smart-query-string';
// Parse a query string
const params = queryString.parse('foo=bar&baz=qux');
// Returns: { foo: 'bar', baz: 'qux' }
// Parse URL with query string
const {url, query} = queryString.parseUrl('https://example.com?foo=bar');
// url: 'https://example.com'
// query: { foo: 'bar' }
import {queryString} from 'smart-query-string';
// Stringify an object
const query = queryString.stringify({foo: 'bar', baz: 'qux'});
// Returns: 'foo=bar&baz=qux'
// Stringify with URL
const url = queryString.stringifyUrl({
url: 'https://example.com',
query: {foo: 'bar'}
});
// Returns: 'https://example.com?foo=bar'
This package is written in TypeScript and includes type definitions out of the box.
MIT © Mohamed Zaki
FAQs
A lightweight TypeScript utility for parsing and manipulating query strings — no dependencies.
We found that smart-query-string demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.