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

@hackclub/markdown

Package Overview
Dependencies
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hackclub/markdown

Render Markdown to HTML, Hack Club-style

  • 0.0.43
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

@hackclub/markdown

Render Markdown to HTML, Hack Club-style. Used primarily on the Hack Club Workshops site.

yarn add @hackclub/markdown
# npm i @hackclub/markdown

Try the demo

Usage

This package does not include any frontend code, such as React or CSS.

This package is designed for rendering at build or otherwise on a server, not client-side— the bundle size is significant & it’s not been optimized for performance.

Always use with await.

import fs from 'fs'
import md from '@hackclub/markdown'

const getReadme = async () => (
  const text = fs.readFileSync('./README.md', 'utf8')
  return await md(text, '/README.md', '/static')
)
ParamDefaultDescription
inputReq’d!String. The Markdown text to transform.
filePath'/README.md'String. The Markdown’s path (for fixing relative image links).
imagePrefix'/'String. A prefix for the path to relative images.
removeTitlefalseBool. Remove starting h1 (if titles are rendered separately).

If you need to parse frontmatter, we recommend using gray-matter alongside @hackclub/markdown, but it’s not included in this package.


Partially based on the Next.js documentation site.

MIT License

FAQs

Package last updated on 24 Nov 2021

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