Plaint Text To HTML Link Converter – Anchorme.js

Category: Javascript , Recommended , Text | April 3, 2020
Author: alexcorvi
Views Total: 2,200
Official Page: Go to website
Last Update: April 3, 2020
License: MIT


Plaint Text To HTML Link Converter – Anchorme.js


Anchorme.js is simple yet robust JavaScript library that finds URs, IPs, files and email addresses in your plain text and convert them into clickable html links. Works with Node.js and browser.


$ npm install anchorme

How to use it:

// NPM
var anchorme = require("anchorme").default; 

// ES6 / Typescript style imports
import anchorme from "anchorme";

Or directly include the JavaScript anchorme.js on the webpage.

<script src="anchorme.js"></script>

Basic usage:


Default configurations.


  //addiontal attributes
  attributes: [],

  // converts IPs
  ips: true,

  // converts email addresses
  emails: true,

  // converts URLs
  urls: true,

  // converts files
  files: true,

  // truncate links
  truncate: Infinity,

  // default protocol
  defaultProtocol: "http://",

  // Although anchorme was authored to transform URLs in text strings to a click-able HTML anchor tags, passing `true` to `list` property in options will change the library's behavior and instead of returning a text with an HTML tags it will only return an array of valid URLs.
  list: false


v2.0 (04/03/2020)

  • Update

You Might Be Interested In:

Leave a Reply