Gathering detailed insights and metrics for linkify-it
Gathering detailed insights and metrics for linkify-it
Gathering detailed insights and metrics for linkify-it
Gathering detailed insights and metrics for linkify-it
@types/linkify-it
TypeScript definitions for linkify-it
marked-linkify-it
marked extension to use linkify-it for autolinks
linkify-it-tlds
Comprehensive list of TLDs, sourced from ICANN, for linkify-it.
react-linkify-it
A tiny and dependency free universal linking solution that turns any pattern in your text into clickable links (aka linkify). Supports i18n and emojis.
Links recognition library with full unicode support
npm install linkify-it
98.7
Supply Chain
99.6
Quality
76.7
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
669 Stars
159 Commits
63 Forks
12 Watching
2 Branches
14 Contributors
Updated on 13 Nov 2024
Minified
Minified + Gzipped
JavaScript (93.56%)
HTML (3.53%)
CSS (2.91%)
Cumulative downloads
Total Downloads
Last day
-4.3%
1,581,930
Compared to previous day
Last week
4%
8,748,019
Compared to previous week
Last month
17.6%
35,307,088
Compared to previous month
Last year
23.2%
371,918,368
Compared to previous year
Links recognition library with FULL unicode support. Focused on high quality link patterns detection in plain text.
Why it's awesome:
1npm install linkify-it --save
Browserification is also supported.
1import linkifyit from 'linkify-it'; 2const linkify = linkifyit(); 3 4// Reload full tlds list & add unofficial `.onion` domain. 5linkify 6 .tlds(require('tlds')) // Reload with full tlds list 7 .tlds('onion', true) // Add unofficial `.onion` domain 8 .add('git:', 'http:') // Add `git:` protocol as "alias" 9 .add('ftp:', null) // Disable `ftp:` protocol 10 .set({ fuzzyIP: true }); // Enable IPs in fuzzy links (without schema) 11 12console.log(linkify.test('Site github.com!')); // true 13 14console.log(linkify.match('Site github.com!')); // [ { 15 // schema: "", 16 // index: 5, 17 // lastIndex: 15, 18 // raw: "github.com", 19 // text: "github.com", 20 // url: "http://github.com", 21 // } ]
1linkify.add('@', { 2 validate: function (text, pos, self) { 3 const tail = text.slice(pos); 4 5 if (!self.re.twitter) { 6 self.re.twitter = new RegExp( 7 '^([a-zA-Z0-9_]){1,15}(?!_)(?=$|' + self.re.src_ZPCc + ')' 8 ); 9 } 10 if (self.re.twitter.test(tail)) { 11 // Linkifier allows punctuation chars before prefix, 12 // but we additionally disable `@` ("@@mention" is invalid) 13 if (pos >= 2 && tail[pos - 2] === '@') { 14 return false; 15 } 16 return tail.match(self.re.twitter)[0].length; 17 } 18 return 0; 19 }, 20 normalize: function (match) { 21 match.url = 'https://twitter.com/' + match.url.replace(/^@/, ''); 22 } 23});
Creates new linkifier instance with optional additional schemas.
Can be called without new
keyword for convenience.
By default understands:
http(s)://...
, ftp://...
, mailto:...
& //...
linksschemas
is an object, where each key/value describes protocol/rule:
:
at the end, skype:
for example). linkify-it
makes sure that prefix is not preceded with
alphanumeric char.RegExp
(start with ^
, and don't include the
link prefix itself), or a validator function which, given arguments
text, pos, and self, returns the length of a match in text
starting at index pos. pos is the index right after the link prefix.
self can be used to access the linkify object to cache data.options
:
http(s)://
head. Default true
.false
.mailto:
prefix. Default true
.true
to terminate link with ---
(if it's considered as long dash).Searches linkifiable pattern and returns true
on success or false
on fail.
Quick check if link MAY BE can exist. Can be used to optimize more expensive
.test()
calls. Return false
if link can not be found, true
- if .test()
call needed to know exactly.
Similar to .test()
but checks only specific protocol tail exactly at given
position. Returns length of found pattern (0 on fail).
Returns Array
of found link matches or null if nothing found.
Each match has:
//
for
protocol-neutral links.Checks if a match exists at the start of the string. Returns Match
(see docs for match(text)
) or null if no URL is at the start.
Doesn't work with fuzzy links.
Load (or merge) new tlds list. Those are needed for fuzzy links (without schema) to avoid false positives. By default:
xn--...
) root zones are ok.If that's not enough, you can reload defaults with more detailed zones list.
Add a new schema to the schemas object. As described in the constructor
definition, key
is a link prefix (skype:
, for example), and value
is a String to alias to another schema, or an Object with validate
and
optionally normalize
definitions. To disable an existing rule, use
.add(key, null)
.
Override default options. Missed properties will not be changed.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More