urls-md
Convert URLs to Markdown links and images: Extracts URLs from text → Gets their article title → Creates Markdown links
Last updated 4 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install urls-md 
SYNC missed versions from official npm registry.

urls-md Build Status

Convert URLs to Markdown links and images

Extracts URLs from textGets their article title → Creates Markdown links and images

Useful for when you have a linkdump and want them in Markdown.

From
Lorem ipsum dolor sit amet
http://updates.html5rocks.com/2014/01/Yo-Polymer-A-Whirlwind-Tour-Of-Web-Component-Tooling
Magnis dis parturient montes.
Lorem http://codelittle.com/tag/yeoman/
https://github.global.ssl.fastly.net/images/modules/logos_page/GitHub-Mark.png
To
[Yo Polymer – A Whirlwind Tour Of Web Component Tooling](http://updates.html5rocks.com/2014/01/Yo-Polymer-A-Whirlwind-Tour-Of-Web-Component-Tooling)

[How To Use Yeoman](http://codelittle.com/tag/yeoman/)

![](https://github.global.ssl.fastly.net/images/modules/logos_page/GitHub-Mark.png)

Install

$ npm install --save urls-md

Usage

const urslMd = require('urls-md');

urlsMd('Lorem ipsum http://codelittle.com/tag/yeoman/').then(urls => {
	console.log(urls);
	//=>  ['[How To Use Yeoman](http://codelittle.com/tag/yeoman/)']
});

API

urlsMd(input)

input

Type: string

Text to extract markdown links and images from.

CLI

$ npm install --global urls-md
$ urls-md --help

  Usage
    urls-md <file>
    cat <file> | urls-md

You can also easily run through multiple files using shell scripting. In this example using ZSH syntax:

# loops through all .txt files in the current directory and outputs the converted files with .md extension
for f (*.txt) { urls-md $f > $f.md }

License

MIT © Sindre Sorhus

Current Tags

  • 3.0.0                                ...           latest (4 years ago)

10 Versions

  • 3.0.0                                ...           4 years ago
  • 2.0.0                                ...           5 years ago
  • 1.3.0                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.2.1                                ...           6 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |