@asyarb/r-url
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

r-URL

Small wrapper around the native URL class that works with relative URLs.

Usage

Install package:

# ✨ Auto-detect
npx nypm install @asyarb/r-url

# npm
npm install @asyarb/r-url

# yarn
yarn add @asyarb/r-url

# pnpm
pnpm install @asyarb/r-url

# bun
bun install @asyarb/r-url

Import:

ESM (Node.js, Bun)

import { RURL } from "@asyarb/r-url";

CommonJS (Legacy Node.js)

const { RURL } = require("@asyarb/r-url");

API

Small wrapper around the native URL class that works with relative URLs.

Basic Usage

const url = new RURL('/about-us')

Setting search parameters

const url = new RURL('/search')
url.searchParams.set('query', 'scholarships')
url.toString() // => "/search?query=scholarships"

Development

local development
  • Clone this repository
  • Install latest LTS version of Node.js
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

License

MIT


🤖 auto updated with automd

Readme

Keywords

Package Sidebar

Install

npm i @asyarb/r-url

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

5.13 kB

Total Files

5

Last publish

Collaborators

  • asyarb