Skip to content

bishakh-dutta/URLifyed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URLifyed

URLifyed is a lightweight npm package that simplifies the process of extracting URLs from plain text and converting them into clickable anchor tags. Whether you're working on a blog, chat application, or any other project, URLifyed has got you covered!

Installation

Install URLifyed using npm:

npm install urlifyed

Usage

  1. Import URLifyed into your project:
const urlifyed = require('urlifyed');
  1. Extract URLs from a string:
const inputText = 'Check out this awesome website: https://example.com and also visit https://another-site.org';
const extractedUrls = urlifyed.extractUrls(inputText);
console.log(extractedUrls);
//Output: 
[
  { url: 'https://example.com', startIndex: 32, endIndex: 51 },
  { url: 'https://another-site.org', startIndex: 67, endIndex: 91 }
]
  1. Convert URLs to anchor tags:
const formattedText = urlifyed.formatWithAnchors(inputText);
console.log(formattedText);
// Output: 'Check out this awesome website: <a href="https://example.com">example.com</a> and also visit <a href="https://another-site.org">another-site.org</a>'

That’s it! URLifyed makes handling URLs a breeze. Happy coding! 🚀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published