1.2.2 • Published 6 years ago

just-location-base v1.2.2

Weekly downloads
13
License
MIT
Repository
github
Last release
6 years ago

Just Location Base

code style: prettier

A simple package which returns a location base and base path.

Why

When you add <base href="/dashboard"> to your HTML, it is quite tedious to get a base or base path inside your JS code.

Installation

npm install just-location-base --save

or

yarn add just-location-base

Usage

HTML:

<head>
  <base href="/dashboard">
</head>

JavaScript:

import { getBase, getBasePath } from 'just-location-base';

const base = getBase(); // "http://localhost/dashboard"
const basePath = getBasePath(); // "/dashboard"
1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago