https://github.com/cy-suite/parse-url
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.8%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: cy-suite
- License: mit
- Language: JavaScript
- Default Branch: master
- Size: 230 KB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
parse-url
An advanced url parser supporting git urls too.
For low-level path parsing, check out parse-path. This very module is designed to parse urls. By default the urls are normalized.
:cloud: Installation
```sh
Using npm
npm install --save parse-url
Using yarn
yarn add parse-url ```
:clipboard: Example
```js // Dependencies import parseUrl from "parse-url";
console.log(parseUrl("http://ionicabizau.net/blog")) // { // protocols: [ 'http' ], // protocol: 'http', // port: '', // resource: 'ionicabizau.net', // user: '', // password: '', // pathname: '/blog', // hash: '', // search: '', // href: 'http://ionicabizau.net/blog', // query: {} // }
console.log(parseUrl("http://domain.com/path/name?foo=bar&bar=42#some-hash")) // { // protocols: [ 'http' ], // protocol: 'http', // port: '', // resource: 'domain.com', // user: '', // password: '', // pathname: '/path/name', // hash: 'some-hash', // search: 'foo=bar&bar=42', // href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash', // query: { foo: 'bar', bar: '42' } // }
// If you want to parse fancy Git urls, turn off the automatic url normalization console.log(parseUrl("git+ssh://git@host.xz/path/name.git", false)) // { // protocols: [ 'git', 'ssh' ], // protocol: 'git', // port: '', // resource: 'host.xz', // user: 'git', // password: '', // pathname: '/path/name.git', // hash: '', // search: '', // href: 'git+ssh://git@host.xz/path/name.git', // query: {} // }
console.log(parseUrl("git@github.com:IonicaBizau/git-stats.git", false)) // { // protocols: [ 'ssh' ], // protocol: 'ssh', // port: '', // resource: 'github.com', // user: 'git', // password: '', // pathname: '/IonicaBizau/git-stats.git', // hash: '', // search: '', // href: 'git@github.com:IonicaBizau/git-stats.git', // query: {} // } ```
:question: Get Help
There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. :bug:
- For direct and quick help, you can use Codementor. :rocket:
:memo: Documentation
interopDefaultLegacy()
PURE
parseUrl(url, normalize)
Parses the input url.
Note: This throws if invalid urls are provided.
Params
- String
url: The input url. Boolean|Object
normalize: Whether to normalize the url or not. Default isfalse. Iftrue, the url will be normalized. If an object, it will be the options object sent tonormalize-url.For SSH urls, normalize won't work.
Return
- Object An object containing the following fields:
protocols(Array): An array with the url protocols (usually it has one element).protocol(String): The first protocol,"ssh"(if the url is a ssh url) or"file".port(null|Number): The domain port.resource(String): The url domain (including subdomains).host(String): The fully qualified domain name of a network host, or its IP address.user(String): The authentication user (usually for ssh urls).pathname(String): The url pathname.hash(String): The url hash.search(String): The url querystring value.href(String): The input url.query(Object): The url querystring, parsed as object.parse_failed(Boolean): Whether the parsing failed or not.
GIT_RE
([a-zA-Z][a-zA-Z0-9-]{0,31}) Try to match the user ([\w.-@]+) Match the host/resource (([~,.\w,-,_,\/,\s]|%[0-9A-Fa-f]{2})+?(?:.git|\/)?) Match the path, allowing spaces/white
:yum: How to contribute
Have an idea? Found a bug? See how to contribute.
:sparkling_heart: Support my projects
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
- Starring and sharing the projects you like :rocket:
—I love books! I will remember you after years if you buy me one. :grin: :book:
—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
Bitcoin—You can send me bitcoins at this address (or scanning the code below):
1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Thanks! :heart:
:dizzy: Where is this library used?
If you are using this library in one of your projects, add it in this list. :sparkles:
@_nomtek/react-native-shimmer-animation@aabelmann/ui-layer@ali5049/react-native-buttons@amirdiafi/react-native-ios-haptics@angga30prabu/wa-modified@apardellass/react-native-audio-stream@aysea/react-native-ui-library@azalpacir/react-native-dhp-printer@brantalikp/rn-resize@buganto/client@con-test/react-native-concent-common@cs6/react-native-test-native-view-library@damruravihara/react-native-testing-package@dataparty/api@enkeledi/react-native-week-month-date-picker@extrieve_technologies/quickcapture_react_native@foundernetes/machines@foundernetes/metal-debian@geeky-apo/react-native-advanced-clipboard@hbglobal/react-native-actions-shortcuts@heycharge/heycharge-react-native-sdk@hieuquang2212/form@hstech/utils@idas1/ui-component-lib@jfilipe-sparta/react-native-module_2@jimengio/mocked-proxy@klevn/solid-router@lakutata-module/service@mockswitch/cli@ndla/source-map-resolver@npm_fluentco/adflow-react-native-sdk@oiti/rn-liveness2d@open-wa/wa-automate@phpboyscout/semantic-release-gitlab@phuocnb/semrelease-gitlab@positionex/position-sdk@praella/localisationist@qiwi/sourcecrumbs@react-native-ui-design/button@roq/ui-react@roshub/api@saad27/react-native-bottom-tab-tour@semantic-release/gitlab@sephriot/react-native-persistable-uri@sidghimire/react-native-mapbox-navigation@taingo97/react-native-awesome-module@taingo97/react-native-bluetooth-xprinter@taingo97/react-native-expo-key-rsa-kt@taingo97/react-native-generate-key-rsa@taingo97/react-native-key-rsa@taingo97/react-native-print-xprinter@taingo97/react-native-rsa-expo@taingo97/react-native-sunmi-printer@taingo97/react-native-telpo-printer@teles1-semantic-release/gitlab@thinxviewx/core-rn@tomw2w/my-nuxt-layer@valifysolutions/react-native-vidvliveness@wecraftapps/react-native-use-keyboardagent-get-agentangularvezbaapaas-trackapi-reach-react-native-fixarchlibraryarifbudixzastra-ufo-sdkawesome-module-kdba-js-cookie-bannerbeggbilibili2localbiometric-stbirken-react-native-community-image-editorblitzzzbuild-plugin-ssrcandlelabssdkcheckbox-componentcli-live-tutorialdelta-screendemo-test-scrndeploy-versioningdesign-system-trial-milyasbpadogandev-simple-toastegg-muc-custom-loaderelectron-infoeval-spiderexpo-renavigatefawaterak-online-paymentfawatrak-online-paymentfixed_form_builderfluent.adflow.reactnativesdkfluent.adflow.reactnativesdk-alphafmslframework_test_library_sixdeeframework_test_library_sixdee_newframework_test_library_sixdee_new_newfuge-runnergamification-integration-newgaurav-react-native-loopgenerator-bootstrap-boilerplate-templategenz-native-elementsgh-monoproject-cligit-upgitlab-backup-util-harduinogriffin-ui-libraryheroku-wp-environment-synchologithong1-utilshubot-will-it-connecthui-plugin-wssipsamveljamuskalimjordy-frijters-test-libkakapokhaled-salem-custom-componentsluojia-cli-devmarkdownalint-cli2michael-stunmicrobe.jsmiguelcostero-ng2-toastynative-apple-loginnative-date-picker-modulenative-google-loginnative-kakao-loginnative-modal-damage-vehiclenative-zipndla-source-map-resolvernew-awesome-4321njs-wa-autonormalize-idnormalize-sshnpm_one_12_34_1_npm_one_1_2_3npm_one_2_2npm_qwertyparse-db-uripasbeaucoupmoinsravepayutestingpnm-yph-react-native-custom-componentsproject-wajs-dvpyreswap-sdkquickcapture_react_nativeraact-native-arunramya151reac-native-arun-ramya-testreact-native-additionreact-native-android-video-player-viewreact-native-animate-textreact-native-app-bubblereact-native-app-integrity-checksumreact-native-arps-authorize-netreact-native-arun-ramya-testreact-native-arunjeyam1987react-native-arunmeena1987react-native-arunramya151react-native-auth-service-clientreact-native-aventonfacetec-aventonreact-native-awesome-android-123react-native-awesome-android-123-zeotapreact-native-awesome-module-latestreact-native-awesome-module-tworeact-native-azure-communication-servicesreact-native-badge-controlreact-native-basic-appreact-native-basic-screenreact-native-biometric-authenticatereact-native-bleccs-componentsreact-native-bluetooth-device-detectreact-native-bridge-packagereact-native-bubble-chartreact-native-build-vesion-getterreact-native-check-componentreact-native-chenaarreact-native-components-designreact-native-conekta-card-tokenizerreact-native-contact-listreact-native-cplusreact-native-create-video-thumbnailreact-native-ctp-odpreact-native-dhp-printerreact-native-dimensions-layoutreact-native-dsphoto-modulereact-native-fedlight-dsmreact-native-flyyreact-native-get-countriesreact-native-ghn-ekycreact-native-innity-2react-native-innity-remasterreact-native-input-libraryreact-native-is7react-native-jsi-device-inforeact-native-kakao-mapsreact-native-klarify-iosreact-native-klarify-uireact-native-klcreact-native-lib-test-rn-1react-native-library-testing-422522react-native-line-login-androidreact-native-login-demo-testreact-native-lowlatencyreact-native-loyalty-platformsreact-native-manh-testreact-native-manual-ios-sdkreact-native-modal-progress-barreact-native-module-argereact-native-module-for-testingreact-native-multiplier-altroncosoreact-native-multiplier-componentreact-native-multiplier-demoreact-native-multiplier2react-native-multiplyreact-native-multiply-componentreact-native-multiselectorreact-native-mun-kitreact-native-my-first-try-arun-ramyareact-native-native-audio-enginereact-native-native-ios-test1react-native-nativewindreact-native-nghia-shareringreact-native-nice-learningreact-native-omental-frameworkreact-native-onrampreact-native-payu-payment-testingreact-native-plugpag-wrapperreact-native-progress-arrowreact-native-pulsator-nativereact-native-rabbitmq-allreact-native-radio-bic-group-libreact-native-reanimated-sortable-listreact-native-recent-framework-updatereact-native-responsive-helperreact-native-responsive-sizereact-native-return-usb-datareact-native-rn-appreact-native-rn-icons-libraryreact-native-rom-componentsreact-native-rtn-ips-poslin-testreact-native-sandycomponentreact-native-savczuk-feature-libraryreact-native-sayhello-modulereact-native-screen-idle-timerreact-native-scroll-tab-to-indexreact-native-shared-gesturereact-native-simple-timelinereact-native-sixdee_test_libreact-native-sp-test-commonreact-native-teknoctrl-componentsreact-native-test-comlibraryreact-native-test-module-hhhreact-native-test-viewreact-native-ticker-tapereact-native-tone-frameworkreact-native-transtracker-libraryreact-native-ui-components-libraryreact-native-uvc-camera-androidreact-native-version-appreact-native-volume-phisicalreact-native-withframework-checkreact-native-wtfreact-native-xiaomi-permissionsreact-native-xprinter-thermal-blereact-native-ytximkitreactnativelyreat-native-multiplierkprrefinejs-reporn-adyen-dropinrn-agora-ios-mrn-circular-chartrn-counter-demorn-session-multiplier-demorn-tm-notifyrn_unique_device_idrobots-agentrocompsmart_one_connectsoajs.repositoriessourcecrumbsstunsushi-sdk-ftmtest-haptik-libtest-zeo-collectts-scrapertumblr-texturl-localvision-camera-base64-resizedvision-camera-plugin-face-detectorvision-camera-plugin-scan-facesvrt-clivue-cli-plugin-ice-buildervue-cli-plugin-ut-builderwa-frikzwander-cliwarp-apiwarp-serverweb-yii2wifi_configuration_packageworkpadxbuilder-formsxl-git-upyangtao-jszeo-collectzzzxxxyyy321123
:scroll: License
Owner
- Name: cy-suite
- Login: cy-suite
- Kind: organization
- Repositories: 1
- Profile: https://github.com/cy-suite
GitHub Events
Total
- Public event: 1
Last Year
- Public event: 1
Dependencies
- actions/checkout v3 composite
- actions/setup-node v3 composite
- 261 dependencies
- normalize-url ^7.0.3 development
- pkgroll ^1.11.1 development
- tester ^1.3.1 development
- tsd ^0.24.1 development
- @types/parse-path ^7.0.0
- parse-path ^7.0.0
