JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 777546
  • Score
    100M100P100Q202201F
  • License MIT

Convert a path to a file url: unicorn.jpg → file:///Users/sindresorhus/unicorn.jpg

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 Build Status

Convert a path to a file url: unicorn.jpgfile:///Users/sindresorhus/unicorn.jpg

Install

$ npm install --save file-url

Usage

var 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

CLI

$ npm install --global file-url
$ file-url --help

  Usage
    file-url [path]

  Example
    file-url
    file:///Users/sindresorhus/dev/file-url

License

MIT © Sindre Sorhus