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

@gabio/markdown-transpiler

v1.6.0

Published

A generic and extensible markdown transpiler

Downloads

12

Readme

Build npm version

@gabio/markdown-transpiler

⚙️ An extensible and easy-to-use markdown transpiler!

Why?

What most transpilers do :

  • Transpile at runtime, which takes time and delays your page loading 🙄
  • Only transform to basic HTML that you need to style with global HTML tag selectors 🤮
  • Offer no way to extend their code for adding new transpiling strategies or supporting new file types 😑
  • Do not permit the usage of components 😳

Description

This tool will read markdown files and transform them into the appropriate file type. In order to achieve such a task, three interfaces each play a different role in the process:

  1. A MarkdownParser, used to transform markdown files into HTML or components
  2. An ImportsCreator, used to generate the appropriate import section inside the <script> tag
  3. A FileCreator, used to wrap the parsed content and define the <script> section

The MarkdownTranspiler will take an implementation from each of these interfaces and output the resulting file. Some implementations are already offered to you, but you can always provide your own!

Installation

yarn add --dev @gabio/markdown-transpiler

or

npm install --save-dev @gabio/markdown-transpiler

Usage

A usage example can be found here.

Implementing a MarkdownParser

As stated above, you can provide your own version of any parts of the transpiler. However, the most common interface to be implemented is the MarkdownParser. Here is an example for transpiling to a Svelte component library.

For other interfaces, you can look at the source code for a good idea on how they can be implemented.

Documentation

Future work

  • Adding more options to transpiler (formatting, minifying, etc.)
  • Adding more file types (Vue2 basic, Vue3, React, etc.)