crocser
v1.1.1
Published
Fast, lightweight, tinny url parser
Downloads
21
Maintainers
Readme
Crocser
Fast 🚀, lightweight 🎈, tinny URL parser
I think there are a million similar solutions, but this one takes no more than 5kb and is easy to use
Install ⚙️
$ npm install crocser
# or
$ yarn add crocser
# or
$ pnpm install crocser
Basic example :
import { parseUrl } from 'crocser'
const info = parseUrl('https://vk.com/im?sel=c901')
console.log(info)
Then send a request:
{
"protocol": "https",
"hostname": "vk.com",
"subdomain": "",
"domain": "vk.com",
"domainWithoutSuffix": "vk",
"publicSuffix": "com",
"queryParamsResult": [["sel", "c901"]]
}
For contributors 💻:
How to start ?
- Write your logic
- Write test
$ pnpm run test
if tests passed :
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- ???
- PROFIT!!!