Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

hubdown

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hubdown

Convert markdown to GitHub-style HTML using a common set of remark plugins

Source
npmnpm
Version
2.0.2
Version published
Weekly downloads
152
10.95%
Maintainers
1
Weekly downloads
 
Created
Source

hubdown

Convert markdown to GitHub-style HTML using a common set of remark plugins

Used by electron/i18n and electronjs.org.

remark is a performant markdown parser with a large plugin ecosystem. Unlike some other node markdown parsers that provide syntax highlighting capabilities, remark does not have any native C++ dependencies. This makes it easier to install and reduces the likelihood of system-dependent installation failures.

Plugins

The following remark plugins are used by hubdown:

Installation

npm install hubdown --save

Usage

hubdown exports a single function that returns a promise:

const hubdown = require('hubdown')

hubdown('I am markdown').then(doc => {
  console.log(doc)
})

The resolved promise yields an object with a content property containing the parsed HTML:

{
  content: '<p>I am markdown</p>'
}

API

hubdown(markdownString[, options])

Arguments:

  • markdownString String - (required)
  • options Object - (optional)
    • frontmatter Boolean - Whether or not to try to parse YML frontmatter in the file. Defaults to false.

Returns a promise. The resolved object looks like this:

{
  content: 'HTML goes here'
}

If YML frontmatter is parsed, those properties will be present on the object too:

{
  title: 'The Feminine Mystique',
  author: 'Betty Friedan',
  content: '<p>The Feminine Mystique is a book written by Betty Friedan which is widely credited with sparking the  beginning of second-wave feminism in the United States.</p>'
}

Tests

npm install
npm test

License

MIT

FAQs

Package last updated on 03 Mar 2018

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