Skip to content

JS library to linkify Instagram captions or comments

Notifications You must be signed in to change notification settings

abh1nav/linkify-instagram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linkify-instagram

npm version Build Status

Click here to try it out in your browser.

Sample Usage

var linkify = require('linkify-instagram');

// Linkifies hashtags
console.log(linkify('Hello #World'));
// Hello <a href="https://www.instagram.com/explore/tags/world">#World</a>

// The hastag template is customizable
console.log(linkify('Hello #World', '<a href="https://www.instagram.com/explore/tags/{hashtag}" target="_blank">#{hashtag}</a>'));
// Hello <a href="https://www.instagram.com/explore/tags/world" target="_blank">#World</a>

// Linkifies usernames
console.log(linkify('Hello @hodor'));
// Hello <a href="https://www.instagram.com/hodor">@hodor</a>

// The template is customizable
console.log(linkify('Hello @hodor', undefined, '<a href="https://www.instagram.com/{username}" target="_blank">@{username}</a>'));
// Hello <a href="https://www.instagram.com/hodor" target="_blank">@hodor</a>

About

JS library to linkify Instagram captions or comments

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •