Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

protocolify

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protocolify

Prepend `http://` to humanized URLs like `todomvc.com` and `file://` to file paths

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34K
increased by3.65%
Maintainers
1
Weekly downloads
 
Created
Source

protocolify Build Status

Prepend http:// to humanized URLs like todomvc.com and file:// to file paths

Useful when you want to accept either a local file or URL as argument in your CLI app.

Install

$ npm install --save protocolify

Usage

const protocolify = require('protocolify');

protocolify('todomvc.com');
//=> 'http://todomvc.com'

protocolify('localhost');
//=> 'http://localhost'

protocolify('http://todomvc.com');
//=> 'http://todomvc.com'

// if it exists on disk it will be interpreted as a file and not an URL
protocolify('index.js');
//=> 'file:///Users/sindresorhus/dev/protocolify/index.js'

License

MIT © Sindre Sorhus

Keywords

FAQs

Package last updated on 16 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc