Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/deftomat/just-location-base
- Owner: deftomat
- License: mit
- Created: 2018-02-13T06:40:00.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-23T06:36:23.000Z (about 6 years ago)
- Last Synced: 2024-10-14T06:19:08.253Z (about 1 month ago)
- Topics: base, location, module, path
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/just-location-base
- Size: 40 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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"
```