Prepend
https://to humanized URLs likesindresorhus.comandfile://to file paths
Useful when you want to accept either a local file or URL as argument in your CLI app.
$ npm install protocolify
importprotocolifyfrom'protocolify';protocolify('sindresorhus.com');//=> 'https://sindresorhus.com'protocolify('localhost',{https: false});//=> 'http://localhost'protocolify('https://sindresorhus.com');//=> 'https://sindresorhus.com'// If it exists on disk, it will be interpreted as a file and not a URLprotocolify('index.js');//=> 'file:///Users/sindresorhus/dev/protocolify/index.js'Type: string
The URL to prepend https:// or file path to prepend file://.
Type: object
Type: boolean
Default: true
Prepend https:// instead of http:// to URLs.