crocser
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

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

illustration

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 ?

  1. Write your logic
  2. Write test
$ pnpm run test

illustration

if tests passed :

  1. Create your feature branch (git checkout -b my-new-feature)
  2. Commit your changes (git commit -am 'Add some feature')
  3. Push to the branch (git push origin my-new-feature)
  4. Create new Pull Request
  5. ???
  6. PROFIT!!!

Package Sidebar

Install

npm i crocser

Weekly Downloads

3

Version

1.1.1

License

MIT

Unpacked Size

5.14 kB

Total Files

5

Last publish

Collaborators

  • kitt3911