Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brandonhimpfen/seo-friendly-urls
The seo-friendly-urls package is a utility that helps convert strings to SEO-friendly URLs.
https://github.com/brandonhimpfen/seo-friendly-urls
seo seo-friendly seo-friendly-urls
Last synced: 26 days ago
JSON representation
The seo-friendly-urls package is a utility that helps convert strings to SEO-friendly URLs.
- Host: GitHub
- URL: https://github.com/brandonhimpfen/seo-friendly-urls
- Owner: brandonhimpfen
- License: mit
- Created: 2023-06-19T21:51:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-19T22:27:53.000Z (over 1 year ago)
- Last Synced: 2024-11-06T02:52:56.476Z (about 2 months ago)
- Topics: seo, seo-friendly, seo-friendly-urls
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/seo-friendly-urls
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# seo-friendly-urls
The "seo-friendly-urls" package is a utility that helps convert strings to SEO-friendly URLs by removing special characters and stop words.
## Installation
You can install the package using npm:
```
npm install seo-friendly-urls
```## Usage
To use the "seo-friendly-urls" package, require it in your JavaScript file:
```
const seoFriendlyUrls = require('seo-friendly-urls');const input = 'This is a test string!';
const output = seoFriendlyUrls(input);
console.log(output);
// Output: "this-is-test-string"
```The main function provided by the package is `seoFriendlyUrls`. It takes an input string and returns a SEO-friendly URL.
## How it works
The `seoFriendlyUrls` function performs the following transformations on the input string:
* **Removes special characters**: Special characters such as symbols and punctuation marks are removed from the string.
* **Removes stop words**: Common stop words, such as articles and conjunctions, are removed from the string.
* **Converts spaces to hyphens**: Any remaining spaces in the string are replaced with hyphens (-).
* **Converts to lowercase**: The resulting string is converted to lowercase.By applying these transformations, the package generates SEO-friendly URLs that are cleaner and more digestable.