npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

md-links-archiver

v1.0.9

Published

parse links within markdown documents and extract content of linked websites

Downloads

7

Readme

md-links-archiver

Parse links within markdown documents and extract content of linked websites. Supports various formats, including HTML, PDF, PNG and TXT.

This tool serves as a safeguard for preserving or "archiving" references that may be at risk of removal or alteration in the future.

Installation

npm install md-links-archiver

Usage

Using mla here, but can be required as any variable name.

mla(<markdown>, <['html' | 'pdf' | 'png' | 'txt']>)
  • pdf and png: returns Buffer
  • html and txt: retuns string

Example

var mla = require('md-links-archiver')

const markdown = `[c](https://en.wikipedia.org/wiki/C_(programming_language))
                  [c++](https://en.wikipedia.org/wiki/C%2B%2B)
                  [c#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language))
`

mla(markdown, ['pdf', 'txt']).then(archive => console.log(archive)) 


/*
[
  WebArchive {
    name: 'C (programming language) - Wikipedia',
    url: 'https://en.wikipedia.org/wiki/C_(programming_language)',
    html: null,
    pdf: <Buffer 25 50 44 46 2d 31 2e 34 0a 25 d3 eb e9 e1 0a 31 20 30 20 6f 62 6a 0a 3c 3c 2f 43 72 65 61 74 6f 72 20 28 4d 6f 7a 69 6c 6c 61 2f 35 2e 30 20 5c 28 58 ... 1665334 more bytes>,
    png: null,
    txt: ...
      'C (pronounced /ˈsiː/ – like the letter c)[6] is a general-purpose computer programming language. 
      It was created in the 1970s by Dennis Ritchie, and remains very widely used and influential.
      ...
  },
  WebArchive {
    name: 'C++ - Wikipedia',
    url: 'https://en.wikipedia.org/wiki/C%2B%2B',
    html: null,
    pdf: <Buffer 25 50 44 46 2d 31 2e 34 0a 25 d3 eb e9 e1 0a 31 20 30 20 6f 62 6a 0a 3c 3c 2f 43 72 65 61 74 6f 72 20 28 4d 6f 7a 69 6c 6c 61 2f 35 2e 30 20 5c 28 58 ... 1654175 more bytes>,
    png: null,
    txt: ...
      'C++ (/ˈsiː plʌs plʌs/, pronounced "C plus plus" and sometimes abbreviated as CPP) 
      is a high-level, general-purpose programming language created by Danish computer scientist Bjarne Stroustrup.
      ...
  },
  WebArchive {
    name: 'C Sharp (programming language) - Wikipedia',
    url: 'https://en.wikipedia.org/wiki/C_Sharp_(programming_language)',
    html: null,
    pdf: <Buffer 25 50 44 46 2d 31 2e 34 0a 25 d3 eb e9 e1 0a 31 20 30 20 6f 62 6a 0a 3c 3c 2f 43 72 65 61 74 6f 72 20 28 4d 6f 7a 69 6c 6c 61 2f 35 2e 30 20 5c 28 58 ... 1349274 more bytes>,
    png: null,
    txt: ...
      'C# (/ˌsiː ˈʃɑːrp/ see SHARP)[b] is a general-purpose high-level programming language supporting 
      multiple paradigms. C# encompasses static typing,[16]: 4  strong typing, lexically scoped, 
      imperative, declarative, functional, generic,[16]: 22  object-oriented (class-based), and 
      component-oriented programming disciplines.
      ...
  }
]
*/

Testing

npm run test

License

MIT