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

urlium

v0.1.2

Published

Build most standard urls with minimal hassle and minus the string manipulation

Readme

urlium

Build most standard urls with minimal hassle and minus the string manipulation

import { Builder } from 'urlium';

const url = 'https://github.com/{user}/{repo}';
const user = 'ikeohachidi';
const repo = 'url-builder';
const builder1 = Builder(url)
				.setParams({
					user,
					repo
				})
				.setQuery('lang', 'en')

console.log(builder.toString())
// expected output: https://github.com/ikeohachidi/url-builder?lang=en

Methods

toObject

Returns raw underlying object

addParam

Adds a parameter to the resulting url

const url = Builder('https://github.com')
			.addParam('hello', 'world');
			.toString();
// result: https://github.com/hello/world

setParams

Can update the value of multiple param placeholders

const url = Builder('https://github.com/{user}/{repo}')
			.setParams({
				user: 'ikeohachidi',
				repo: 'iono'
			})
			.toString();
// result: https://github.com/ikeohachidi/iono

setParam

Update the value of single param placeholder

const url = Builder('https://github.com/{user}/{repo}')
			.setParam('user', 'ikeohachidi');
			.toString()
// result: https://github.com/ikeohachidi

getParams

Returns all param placeholders and their values or returns an object with incrementing keys starting from 0 if placeholders aren't found. Can also optionally return a single param value

const url = Builder('https://github.com/ikeohachidi/iono')
			.getParams();
// result: {
// 	0: 'ikeohachidi',
// 	1: 'iono'
// }

const url2 = Builder('https:github.com/{user}/iono')
			.setParam('user', 'ikeohachidi')
			.getParams('user');
// result: 'ikeohachidi'

setQuery

Adds and updates query values

const url = Builder('https:github.com/ikeohachidi')
			.setQuery('country', 'nigeria')
			.setQuery('state', 'rivers');

// result: https://github.com/ikeohachidi?country=nigeria&state=rivers

getQuery

Retrieves the decoded value of a single query

const url = Builder('https:github.com/ikeohachidi?value=hello%20')
			.getQuery('value')

// result: hello world 

getRawQuery

Retrieves the value of single query as is

const url = Builder('https:github.com/ikeohachidi?value=hello%20world')
			.getQuery('value')

// result: hello%20world 

setHostName

Update the value of the hostname

const url = Builder('https://github.com')
			.setHostName('google.com')
			.toString();

// result: https://google.com

getHostName

Update the value of the url hostname

const url = Builder('https://github.com')
			.getHostName();

// result: github.com

setScheme

Update the value of the url scheme

const url = Builder('https://github.com')
			.setScheme('ws')
			.toString();

// result: ws://github.com

getScheme

Update the value of the url scheme

const url = Builder('https://github.com')
			.getScheme()

// result: https 

toString

Return built url string

const url = Builder('http://google.com')
			.setScheme('https')
			.setHostName('github')
			.toString()

// result: https://github.com