@reskit/link
v1.3.1
Published
A kit to extract link
Downloads
4
Maintainers
Readme
Install
Install @reskit/link
by pnpm
pnpm add @reskit/link
Functions
Extract Link
Input
import { extractLink } from "@reskit/link";
extractLink("the link is: ftp://192.168.0.111/");
Output
["ftp://192.168.0.111/"]
Extract Multiple Links
extractLink("the link is: http://www.google.com:80/s?wd=vue#page and mailto://www.baidu.com/s !");
Output
["http://www.google.com:80/s?wd=vue#page", "mailto://www.baidu.com/s"];
Extract Link From a Tag
extractLink("the link is: <a target='_blank' href='http://www.baidu.com/'>Baidu</a>");
Output
["http://www.baidu.com/"]
Extract Path-Like Link
extractLink("the path is: ./usr/local/bin", { includePath: true });
Output
["./usr/local/bin"]
Others
Welcome to create PR and make @reskit/link better!