Convert a file path to a file URL: `unicorn.jpg` → `file:///Users/sindresorhus/unicorn.jpg`
by sindresorhusJavaScript
Last 12 weeks · 0 commits
4 of 6 standards met
I was comparing this module to vscode-uri, and one major difference is that vscode-uri only converts to on Windows. on other platforms, it says, is a valid segment character, like . I didn't confirm if that's true (sorry for being lazy!) but thought I'd bring it up. https://github.com/microsoft/vscode-uri/blob/413805221cc6ed167186ab3103d3248d6f7161f2/src/index.ts#L744-L769
not sure why it was added in the first place but it seems to be causing problems here: https://github.com/mifi/lossless-cut/issues/1941 e.g. on macos when trying to encode a file name with a backslash in it, it causes the backslashe to interpreted as forward slashes, which is not correct and causes the process opening the file to fail. example: it should become
1. This package has a dependency on the package 'path' but it was not declared as a dependency in the package.json 2. With Node 14 or higher, declaring the exports section in the package.json without also including the package.json file itself will generate a warning during build. Removing the exports section from the package.json resolves the warning. See https://github.com/react-native-community/cli/issues/1168 for more details.
Repository: sindresorhus/file-url. Description: Convert a file path to a file URL: `unicorn.jpg` → `file:///Users/sindresorhus/unicorn.jpg` Stars: 63, Forks: 10. Primary language: JavaScript. Languages: JavaScript (88.4%), TypeScript (11.6%). License: MIT. Latest release: v4.0.0 (5y ago). Open PRs: 0, open issues: 0. Last activity: 2y ago. Community health: 85%. Top contributors: sindresorhus, arthurvr, dciccale, BendingBender, felixfbecker, kevinoid, Richienb.