
Security Fundamentals
Obfuscation 101: Unmasking the Tricks Behind Malicious Code
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
@raulingg/md-links
Advanced tools
This repository is an implementation of this proposal
Find all links included in a markdown file or in all markdown files inside a folder.
to install globally
npm install -g @raulingg/md-links
to install as a dependency in your project
npm install @raulingg/md-links
Requiring dependency
const mdLinks = require('@raulingg/md-links')
mdLinks('path/to/file.md')
.then(mdlink => {
// Return an object with two methods data and stats
// data() return an array with results
mdlink.data().forEach(item => {
console.log(item.path, item.href, item.text)
})
});
// find links in all markdown files inside a directory
mdLinks('path/to/directory').data().then(data => {});
Importing using ES6
import mdLinks from require('@raulingg/md-links')
const mdlink = await mdLinks('path/to/file.md')
const results = mdlink.data()
// do whatever you want
validate broken links
mdLinks('path/to/file.md', { validate: true}).then((mdlink) => {
mdlink.data().forEach((item) => {
console.log(item.path, item.text, item.href, item.status, item.statusCode)
})
});
Get stats
/**
* Stats Object
* {
* total: <#linksFound>
* unique: <#LinksUnique>
* broken: <#LinksBroken>
* }
*/
mdLinks('path/to/file.md').then(mdlink => mdlink.stats());
// get stats from broken links
mdLinks('path/to/file.md', { validate: true}).then(mdlink => mdlink.stats());
Basic usage
# single file
md-links <path/to/file.md>
# scan all markdown files in directory
md-links <path/to/directory>
Adding a validation option (--validate or -val)
md-links <path/to/directory> --validate
Get stats about how many links and broken links exist
md-links <path/to/directory> --stats
# validate and return stats
md-links <path/to/directory> --validate --stats
Basic Cases
[valid link](http://test.com)
[test-link@test.com](http://test.com/test-link?djdjd&)
[title (parenthesis)](http://www.test.com)
[title with
linebreak](http://test.com)
Extra Cases
[[extra sq bracket](https://test.com?g=154&fh=!445?)
Video Case
Find image and video url
[](https://www.youtube.com/watch?v=Ix6VLiBcABw)
Unsupported Cases
[extra sq bracket - invalid]](https://test.com)
[link with linebreak - invalid](http:
//test.com)
FAQs
This library allows you to find links within markdown files
We found that @raulingg/md-links demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
Security News
Biome's v2.0 beta introduces custom plugins, domain-specific linting, and type-aware rules while laying groundwork for HTML support and embedded language features in 2025.