Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/deftomat/just-location-base

Returns a location base and base path.
https://github.com/deftomat/just-location-base

base location module path

Last synced: 18 days ago
JSON representation

Returns a location base and base path.

Awesome Lists containing this project

README

        

# Just Location Base

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

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

## Why ?

When you add `` 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:

```html

```

JavaScript:

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

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