libreccm-legacy/trunk-images/node_modules/url-parse-lax
baka a212bb7b37 [3056] Adds Plugin to add Images from the system in tinymce. Now with files...
git-svn-id: https://svn.libreccm.org/ccm/trunk@5722 8810af33-2d31-482b-a856-94f89814c4df
2018-11-03 23:44:15 +00:00
..
index.js [3056] Adds Plugin to add Images from the system in tinymce. Now with files... 2018-11-03 23:44:15 +00:00
license [3056] Adds Plugin to add Images from the system in tinymce. Now with files... 2018-11-03 23:44:15 +00:00
package.json [3056] Adds Plugin to add Images from the system in tinymce. Now with files... 2018-11-03 23:44:15 +00:00
readme.md [3056] Adds Plugin to add Images from the system in tinymce. Now with files... 2018-11-03 23:44:15 +00: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