
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
A library to deal with links that real users actually type.
Note: if you want a 100% bullet proof solution, have a look at linkify-it and node-tlds.
In theory, matching an url is quite easy as it is supposed to start by whether http://
or https://
.
But in a real world scenario, users are more likely to omit the protocol and simply type site.com
.
That's where linkhunter comes into play, it is focused on dealing with links from users inputs.
The library is able to match:
http://twitter.com/
from Have a look at http://twitter.com/
github.com
from Feel free to submit an issue on github.com!
someone@domain.com
from Should I contact someone@domain.com?
twitter.com
from Did you visit twitter? (twitter.com)
npm install linkhunter --save
The whole api has been redesigned to make things simpler and more flexible. Please have a look at the documentation for the detailed changes.
linkhunter.replaceLinks
doesn't support the context argument anymorenpm install linkhunter --save
site.com
in (site.com)
, site.com.
, site.com...
, site.com!
, and so on.site.com
in Some string ((whatever(site.com)some stuff) there
someone@domain.com
in Whatever (stuff((there(or(someone@domain.com)So weird) string...
github.com/angular.js
(urls with punctuation marks)http://site.com
in What?http://site.com
site.com)whatever
but site.com/whatever
linkhunterLinky
.linkhunter.linky()
's operation
option has been replaced by individual properties that alter the link's display value (see documentation for more details).mailto:
is now considered to be emails' protocol, meaning Link('email@domain.com').withProtocol()
now returns mailto:email@domain.com
.targetBlank
option of .linky()
is replaced by target
to allow any target value.firstname.lastname@email.address-site.com
..getLinks()
now ignore emails by default..looksLikeALink()
now ignore emails by default.forceCleanUp
option to .shorten()
(true by default).bower install linkhunter
.http://.
is no more matched for example.github.com/angular
is no more matched from github.com/angular.js
. In such case the url is completely dropped because:
.replaceLinks(callback)
method so your could benefit from linkhunter's regexps to replace links the way you want to. This is method is now also used by .linky()
..linky()
now supports more options like beautify, shorten and clean up..originalHasProtocol
property which is true when the original url has a protocol..getLinks()
wasn't setting emails' type to "email".First release.
FAQs
A library to deal with links that real users actually type.
We found that linkhunter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.