A simple NPM to convert local file locations into URI acceptable strings.
How to install
npm install --save encode-path-to-uri
Example on usage
const encodePathToUri = ; const encodedPath = ;console; // /home/user/caffiend/How%20to%20brew%20coffee.pdf