2.1.9 • Published 7 years ago
mini-url v2.1.9
Light weight, universal, URL parser for node and the browser with built in caching.
Installation
npm install mini-url
Example
import { parse, stringify } from 'mini-url'
// Parse a url into an object.
parse('http://host.com:8080/p/a/t/h?query=string#hash')
/* {
protocol: 'http:',
host: 'host.com:8080',
port: '8080',
hostname: 'host.com',
hash: '#hash',
search: '?query=string',
pathname: '/p/a/t/h',
href: 'http://host.com:8080/p/a/t/h?query=string#hash'
} */
// Stringify an object into a url string.
stringify({
protocol: 'http:',
host: 'host.com:8080',
hash: '#hash',
search: '?query=string',
pathname: '/p/a/t/h'
})
/* http://host.com:8080/p/a/t/h?query=string#hash */
Contributions
- Use
npm test
to build and run tests.
Please feel free to create a PR!
2.1.9
7 years ago
2.1.8
7 years ago
2.1.7
7 years ago
2.1.5
7 years ago
2.1.4
7 years ago
2.1.3
7 years ago
2.1.2
7 years ago
2.1.1
7 years ago
2.1.0
7 years ago
2.0.3
7 years ago
2.0.2
7 years ago
2.0.1
7 years ago
2.0.0
7 years ago
1.6.1
7 years ago
1.6.0
7 years ago
1.5.1
7 years ago
1.5.0
7 years ago
1.4.0
7 years ago
1.3.0
7 years ago
1.2.0
7 years ago
1.1.2
7 years ago
1.1.1
7 years ago
1.1.0
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago