dijkstra-backend-cloudron/node_modules/url-parse-lax
rui hildt 4f5db9ab26 Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00
..
index.js Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00
license Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00
package.json Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00
readme.md Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00

readme.md

url-parse-lax Build Status

url.parse() with support for protocol-less URLs & IPs

Install

$ npm install --save url-parse-lax

Usage

var urlParseLax = require('url-parse-lax');

urlParseLax('sindresorhus.com');
/*
{
	protocol: null,
	slashes: true,
	auth: null,
	host: 'sindresorhus.com',
	port: null,
	hostname: 'sindresorhus.com',
	hash: null,
	search: null,
	query: null,
	pathname: '/',
	path: '/',
	href: 'http://sindresorhus.com/'
}
*/

urlParseLax('[2001:db8::]:8000');
/*
{
	protocol: null,
	slashes: true,
	auth: null,
	host: '[2001:db8::]:8000',
	port: '8000',
	hostname: '2001:db8::',
	hash: null,
	search: null,
	query: null,
	pathname: '/',
	path: '/',
	href: 'http://[2001:db8::]:8000/'
}
*/

And with the built-in url.parse():

var url = require('url');

url.parse('sindresorhus.com');
/*
{
	protocol: null,
	slashes: null,
	auth: null,
	host: null,
	port: null,
	hostname: null,
	hash: null,
	search: null,
	query: null,
	pathname: 'sindresorhus',
	path: 'sindresorhus',
	href: 'sindresorhus'
}
*/

url.parse('[2001:db8::]:8000');
/*
{
	protocol: null,
	slashes: null,
	auth: null,
	host: null,
	port: null,
	hostname: null,
	hash: null,
	search: null,
	query: null,
	pathname: '[2001:db8::]:8000',
	path: '[2001:db8::]:8000',
	href: '[2001:db8::]:8000'
}
*/

License

MIT © Sindre Sorhus