New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

transform-markdown-links

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

transform-markdown-links

Transform the links in a Markdown file

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.9K
increased by5.39%
Maintainers
1
Weekly downloads
 
Created
Source

Tests npm

Transform the links in a Markdown file

Transforms the URLs of links in a Markdown file using a transform function.

Installation

npm install transform-markdown-links

Usage

import transformLinks from 'transform-markdown-links';

const input = 'This [link](page.md) will be transformed.';

transformLinks(input, (link, text) => link + '?hooray');
// => 'This [link](page.md?hooray) will be transformed.'

API

transformLinks(input, transform)

Transform the links in a Markdown string using a transform function. Returns a String of Markdown with transformed links.

  • input (String): Markdown input.
  • transform (Function): Callback to transform each link. Should return a string to change the link's URL, or undefined to leave it as-is. Gets these parameters:
    • link (String): URL of the link.
    • text (String): text of the link.

Local Development

git clone https://github.com/gakimball/transform-markdown-links
cd transform-markdown-links
npm install
npm test

License

MIT © Geoff Kimball

Keywords

FAQs

Package last updated on 14 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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