Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@reskit/link

simo-an9Apache-2.01.3.1TypeScript support: included

A kit to extract link

extract link, extract url, reskit, link, extraction

readme

Install

Install @reskit/link by pnpm

pnpm add @reskit/link

Functions

Input

import { extractLink } from "@reskit/link";

extractLink("the link is: ftp://192.168.0.111/");

Output

["ftp://192.168.0.111/"]
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"];
extractLink("the link is: <a target='_blank' href='http://www.baidu.com/'>Baidu</a>");

Output

["http://www.baidu.com/"]
extractLink("the path is: ./usr/local/bin", { includePath: true });

Output

["./usr/local/bin"]

Others

Welcome to create PR and make @reskit/link better!

changelog

1.3.1

Features

  1. Feat: Support extract color in image
  2. Feat: Support extract date in Chinese

1.3.0

Features

  1. Feat: Support extract link from text
  2. Feat: Support extract emoji from text
  3. Feat: Support extract color from text

Features

1.2.4 (2023/08/23)

Features

  1. extract-number: Feat support extract plain number when not localized

1.2.3 (2023/08/22)

Features

  1. Feat: Support extract and compute math expression from text

1.2.2 (2023/08/21)

Features

  1. extract-number: Feat support extract fraction and negative number

1.2.1 (2023/08/21)

Fixes

  1. extract-number: Fix special text caused error extract result

1.2.0 (2023/08/20)

Features

  1. Feat: Support extract number from text in chinese

1.1.0 (2023/08/20)

Features

  1. Feat: Support extract location from text

1.0.1 (2023/08/19)

Features

  1. extract-room: Feat support set building without name
  2. extract-room: Feat support keep alias at extracted results

1.0.0 (2023/08/19)

Features

  1. Feat: Support extract room location from text