npm.io
1.1.1 • Published 6 years ago

get-base-path

Licence
MIT
Version
1.1.1
Deps
0
Size
1 kB
Vulns
0
Weekly
0

get-base-path

Small utility to handle paths for different hosts - for hosting on local/Github/etc.

Usage

import getBasePath from '../';

const url = getBasePath()+'path/to.asset';

console.log(url);

(async () => {
    const response = await fetch(url);

    console.log(response.ok);
})();