markdown-link-extractor
extracts links from markdown texts
Last updated 6 years ago by tcort .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ npm install markdown-link-extractor 
SYNC missed versions from official npm registry.

markdown-link-extractor

Extracts links from markdown texts.

Installation

$ npm install --save markdown-link-extractor

API

markdownLinkExtractor(markdown)

Parameters:

  • markdown text in markdown format.

Returns:

  • an array containing the URLs from the links found.

Examples

const { readFileSync } = require('fs');
const markdownLinkExtractor = require('markdown-link-extractor');

const markdown = readFileSync('README.md', {encoding: 'utf8'});

const links = markdownLinkExtractor(markdown);
links.forEach(link => console.log(link));

Upgrading to v4.0.0

  • anchor link extraction no longer supported

Code that looked like this:

const { links } = markdownLinkExtractor(str);

Should change to this:

const links = markdownLinkExtractor(str);

Upgrading to v3.0.0

  • extended mode no longer supported
  • embedded image size parameters in ![]() no longer supported

Testing

npm test

License

See LICENSE.md

Current Tags

  • 4.0.4                                ...           latest (4 months ago)

25 Versions

  • 4.0.4                                ...           4 months ago
  • 4.0.3                                ...           a year ago
  • 4.0.2                                ...           3 years ago
  • 3.1.0                                ...           4 years ago
  • 4.0.1                                ...           5 years ago
  • 3.0.2                                ...           5 years ago
  • 3.0.1                                ...           5 years ago
  • 4.0.0                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 2.0.1                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.3.1                                ...           5 years ago
  • 1.3.0                                ...           6 years ago
  • 1.2.7                                ...           6 years ago
  • 1.2.6                                ...           6 years ago
  • 1.2.5                                ...           6 years ago
  • 1.2.4                                ...           6 years ago
  • 1.2.3                                ...           7 years ago
  • 1.2.2                                ...           7 years ago
  • 1.2.1                                ...           7 years ago
  • 1.2.0                                ...           8 years ago
  • 1.1.2                                ...           9 years ago
  • 1.1.1                                ...           9 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 76
Today 0
This Week 0
This Month 54
Last Day 0
Last Week 52
Last Month 21
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE