https://github.com/nextlevelshit/is-external-url-ssr
A simple function that tells you whether an URL is external or not even in node and ssr.
https://github.com/nextlevelshit/is-external-url-ssr
a external href internal node ssr url
Last synced: 3 months ago
JSON representation
A simple function that tells you whether an URL is external or not even in node and ssr.
- Host: GitHub
- URL: https://github.com/nextlevelshit/is-external-url-ssr
- Owner: nextlevelshit
- License: wtfpl
- Created: 2020-04-28T10:08:48.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T03:43:24.000Z (over 2 years ago)
- Last Synced: 2025-01-20T22:42:06.760Z (5 months ago)
- Topics: a, external, href, internal, node, ssr, url
- Language: JavaScript
- Size: 79.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
isExternal()
URL · Utility · external · internal · a · href## Quick start
1. **Installation**
Use npm/yarn CLI to install the repository.
```shell
yarn add is-url-external-ssr# OR
npm install is-url-external-ssr
```2. **Usage**
## Usage
```javascript
const isExternal from "is-url-external-ssr"console.log(
isExternal('https://github.com/mrded/is-url-external')
? "It's an external link"
: "It's an internal link width the same hostname"
)
```## What's inside?
A quick look at the top-level files and directories you'll see in a Gatsby project.
.
├── /node_modules
├── index.js
├── LICENSE
├── package.json
├── README.md
└── yarn.lock1. **`/node_modules`**: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed.
2. **`.gitignore`**: This file tells git which files it should not track / not maintain a version history for.
3. **`index.js`**: Main piece of code and functionality.
4. **`LICENSE`**: License agreement for usage and modification of this software.
5. **`package.json`**: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is how npm knows which packages to install for your project.
6. **`README.md`**: A text file containing useful reference information about our project.
7. **`yarn.lock`** (See `package.json` above, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. **(You won’t and shouldn't change this file manually).**
## Who to ask?
This repository is maintained by [Michael Czechowski](mailto:[email protected]) in 2020. If you're having any questions, don't hesitate to write an email.
## Contributions
This software is based on [Dmitry Demenchuk](https://github.com/mrded)'s software [`is-url-external`](https://github.com/mrded/is-url-external). Thanks to him!