1.3.1 • Published 9 months ago

@reskit/link v1.3.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

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!