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

@h3ravel/url

v1.0.20

Published

Request-aware URI builder and URL manipulation utilities for H3ravel.

Readme

Framework URL Package Version Downloads Tests License

About H3ravel/url

Request-aware URI builder and URL manipulation utilities for H3ravel framework.

Installation

npm install @h3ravel/url

Features

  • Static factories for creating URLs from strings, paths, routes, and controller actions
  • Fluent builder API for modifying URLs with immutable chaining
  • Request-aware helpers for working with current request context
  • URL signing capabilities for secure temporary URLs
  • Type-safe query parameters and route parameters

Usage

Basic URL Creation

import { Url } from '@h3ravel/url';

// From string
const url = Url.of('https://example.com/path');

// From path relative to app URL
const url = Url.to('/users');

// From named route
const url = Url.route('users.show', { id: 1 });

// From controller action
const url = Url.action('UserController@index');

Fluent Builder API

const url = Url.of('https://example.com')
  .withScheme('http')
  .withHost('test.com')
  .withPort(8000)
  .withPath('/users')
  .withQuery({ page: 2 })
  .withFragment('section-1')
  .toString();
// -> "http://test.com:8000/users?page=2#section-1"

Request-Aware Helpers

// Get current URL
url().current();

// Get full URL with query string
url().full();

// Get previous URL
url().previous();

// Get previous path only
url().previousPath();

// Get current query parameters
url().query();

Signed URLs

// Create signed route URL
const signedUrl = Url.signedRoute('users.show', { id: 1 });

// Create temporary signed route URL (expires in 5 minutes)
const tempUrl = Url.temporarySignedRoute(
  'users.index',
  {},
  Date.now() + 300000
);

API Reference

Static Methods

  • Url.of(string) - Create from full URL string
  • Url.to(path) - Create from path relative to app URL
  • Url.route(name, params) - Create from named route
  • Url.signedRoute(name, params) - Create signed route URL
  • Url.temporarySignedRoute(name, params, expiration) - Create expiring signed route URL
  • Url.action(controller) - Create from controller action

Instance Methods

  • withScheme(scheme: string) - Set URL scheme
  • withHost(host: string) - Set URL host
  • withPort(port: number) - Set URL port
  • withPath(path: string) - Set URL path
  • withQuery(query: Record<string, any>) - Set query parameters
  • withFragment(fragment: string) - Set URL fragment
  • toString() - Convert to string representation

Request-Aware Functions

  • current() - Get current request URL
  • full() - Get full URL with query string
  • previous() - Get previous request URL
  • previousPath() - Get previous request path
  • query() - Get current query parameters

Contributing

Thank you for considering contributing to the H3ravel framework! The Contribution Guide can be found in the H3ravel documentation and will provide you with all the information you need to get started.

Code of Conduct

In order to ensure that the H3ravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

If you discover a security vulnerability within H3ravel, please send an e-mail to Legacy via [email protected]. All security vulnerabilities will be promptly addressed.

License

The H3ravel framework is open-sourced software licensed under the MIT license.