JSPM

@wordpress/url

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 94285
  • Score
    100M100P100Q201638F
  • License GPL-2.0-or-later

WordPress URL utilities

Package Exports

  • @wordpress/url
  • @wordpress/url/build-module

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@wordpress/url) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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://' to URLs that are probably mean to have them
const actualUrl = prependHTTP( 'wordpress.org' ); // http://wordpress.org



Code is Poetry.