Skip to content

Latest commit

 

History

History

url

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

@wordpress/url

A collection of utilities to manipulate URLs

Installation

Install the module

npm install @wordpress/url --save

Usage

import { addQueryArgs, prependHTTP } from '@wordpress/url';

// Appends arguments to the query string of a given url
const newUrl = addQueryArgs( 'https://google.com', { q: 'test' } ); // https://google.com/?q=test

// Prepends 'http:https://' to URLs that are probably mean to have them
const actualUrl = prependHTTP( 'wordpress.org' ); // http:https://wordpress.org



Code is Poetry.