Package Exports
- file-url
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 (file-url) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
file-url 
Convert a file path to a file url:
unicorn.jpg
→file:///Users/sindresorhus/unicorn.jpg
Install
$ npm install file-url
Usage
const fileUrl = require('file-url');
fileUrl('unicorn.jpg');
//=> 'file:///Users/sindresorhus/dev/file-url/unicorn.jpg'
fileUrl('/Users/pony/pics/unicorn.jpg');
//=> 'file:///Users/pony/pics/unicorn.jpg'
fileUrl('unicorn.jpg', {resolve: false});
//=> 'file:///unicorn.jpg'
API
fileUrl(filePath, [options])
Returns the filePath
converted to a file URL.
filePath
Type: string
File path to convert.
options
Type: Object
resolve
Type: boolean
Default: true
Passing false
will make it not call path.resolve()
on the path.
Related
- file-url-cli - CLI for this module
License
MIT © Sindre Sorhus