New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

urlifyed

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urlifyed

Extract links from sting and add anchor tags to it

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
3
200%
Maintainers
1
Weekly downloads
 
Created
Source

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

  • Import URLifyed into your project:
const urlifyed = require('urlifyed');
  • 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 }
]

  • 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! 🚀

Keywords

url

FAQs

Package last updated on 06 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts