Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

markdown-link

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-link - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

15

index.js
'use strict';
module.exports = mdlink;
/**
* Create a markdown-formatted link from the given values.
*
* ```js
* mdlink('foo', 'https://github.com/bar/foo', 'baz');
* //=> [foo](https://github.com/bar/foo "baz")
*
* mdlink('foo', 'https://github.com/bar/foo');
* //=> [foo](https://github.com/bar/foo)
* mdlink('micromatch', 'https://github.com/jonschlinkert/micromatch', 'hover title');
* //=> [micromatch](https://github.com/jonschlinkert/micromatch "hover title")
* ```
*
* @name link
* @param {String} `anchor`

@@ -20,4 +18,3 @@ * @param {String} `href`

function mdlink(anchor, href, title) {
module.exports = function link(anchor, href, title) {
if (typeof anchor !== 'string') {

@@ -24,0 +21,0 @@ throw new TypeError('markdown-link expects anchor to be a string.');

2

package.json
{
"name": "markdown-link",
"description": "Micro util for generating a single markdown link.",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/jonschlinkert/markdown-link",

@@ -6,0 +6,0 @@ "author": {

@@ -15,15 +15,23 @@ # markdown-link [![NPM version](https://badge.fury.io/js/markdown-link.svg)](http://badge.fury.io/js/markdown-link)

var mdlink = require('markdown-link');
```
mdlink('abc', 'https://github.com/xyz/abc');
//=> [abc](https://github.com/xyz/abc)
## Usage
### [.link](./index.js#L18)
mdlink('abc', 'https://github.com/xyz/abc', 'Title text.');
//=> [abc](https://github.com/xyz/abc "Title text.")
Create a markdown-formatted link from the given values.
* `anchor` **{String}**
* `href` **{String}**
* `title` **{String}**
```js
mdlink('micromatch', 'https://github.com/jonschlinkert/micromatch', 'hover title');
//=> [micromatch](https://github.com/jonschlinkert/micromatch "hover title")
```
## Related projects
* [remarkable](https://github.com/jonschlinkert/remarkable): Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in one.
* [markdown-toc](https://github.com/jonschlinkert/markdown-toc): Generate a markdown TOC (table of contents) with Remarkable.
* [markdown-utils](https://github.com/jonschlinkert/markdown-utils): Micro-utils for creating markdown snippets.
* [gfm-code-blocks](https://github.com/jonschlinkert/gfm-code-blocks): Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string.
* [remarkable](https://github.com/jonschlinkert/remarkable): Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in one.
* [markdown-toc](https://github.com/jonschlinkert/markdown-toc): Generate a markdown TOC (table of contents) with Remarkable.
* [to-gfm-code-block](https://github.com/jonschlinkert/to-gfm-code-block): Generate a github-flavored-markdown fenced code block snippet.

@@ -53,2 +61,2 @@ ## Running tests

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 14, 2015._
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 20, 2015._
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc