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

moleculer-markdown

v1.0.0

Published

Translates Markdown to Html

Downloads

2

Readme

Moleculer logo

moleculer-markdown

Service mixin to transform markdown to html,

Uses Showdown as markdown processor.

Usage

'use strict';

let { ServiceBroker } = require('moleculer');
let MarkdownService = require('./../src/index');

// Create broker
let broker = new ServiceBroker({
  logger: console,
  logLevel: 'debug'
});

// Load markdown Service
broker.createService({
  name: 'markdown',
  mixins: [MarkdownService],
  settings: {}
});

// Start server
broker.start().then(() => {
  // Call action
  broker
    .call('markdown.transform', { md: '# Hello, Markdown' })
    .then(html => console.log('HTML is ', html));
});

Settings

| Property | Type | Default | Description | | -------------------------------------- | --------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | omitExtraWLInCodeBlocks | Boolean | required | Omit the trailing newline in a code block. | | noHeaderId | Boolean | required | Disable the automatic generation of header ids | | customizedHeaderId | Boolean | required | Use text in curly braces as header id | | ghCompatibleHeaderId | Boolean | required | Generate header ids compatible with github style | | prefixHeaderId | Boolean | required | Add a prefix to the generated header ids | | rawPrefixHeaderId | Boolean | required | Setting this option to true will prevent showdown from modifying the prefix | | rawHeaderId | Boolean | required | Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-) | | parseImgDimensions | Boolean | required | Enable support for setting image dimensions from within markdown syntax | | headerLevelStart | Integer | required | Set the header starting level | | simplifiedAutoLink | Boolean | required | Turning this option on will enable automatic linking to urls | | excludeTrailingPunctuationFromURLs | Boolean | required | This option excludes trailing punctuation from autolinking urls | | literalMidWordUnderscores | Boolean | required | Turning this on will stop showdown from interpreting underscores in the middle of words | | strikethrough | Boolean | required | Enable support for strikethrough syntax | | tables | Boolean | required | Enable support for tables syntax | | tablesHeaderId | Boolean | required | If enabled adds an id property to table headers tags | | ghCodeBlocks | Boolean | required | Enable support for GFM code block style | | tasklists | Boolean | required | Enable support for GFM tasklists | | smartIndentationFix | Boolean | required | Tries to smartly fix indentation problems related to es6 template strings in the midst of indented code | | disableForced4SpacesIndentedSublists | Boolean | required | Disables the requirement of indenting sublists by 4 spaces for them to be nested, effectively reverting to the old behavior where 2 or 3 spaces were enough | | simpleLineBreaks | Boolean | required | Parses line breaks as like GitHub does, without needing 2 spaces at the end of the line | | requireSpaceBeforeHeadingText | Boolean | required | Makes adding a space between # and the header text mandatory | | ghMentions | Boolean | required | Enables github @mentions, which link to the username mentioned | | ghMentionsLink | String | required | Changes the link generated by @mentions. Showdown will replace {u} with the username | | encodeEmails | Boolean | required | Enable e-mail addresses encoding through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities | | openLinksInNewWindow | Boolean | required | Open all links in new windows | | backslashEscapesHTMLTags | Boolean | required | Support for HTML Tag escaping | | emoji | Boolean | required | Enable emoji support | | underline | Boolean | required | EXPERIMENTAL: Enable support for underline, no longer rendered to and | | completeHTMLDocument | Boolean | required | Outputs a complete html document, including , and tags' instead of an HTML fragment | | metadata | Boolean | required | Enable support for document metadata | | splitAdjacentBlockquotes | Boolean | required | Split adjacent blockquote blocks | | flavor | String | required | Set the flavor for markdown. Options are: original, github, vanilla |

Actions

Methods

transform

Transforms markdown into html

Parameters

| Property | Type | Default | Description | | -------- | -------- | ------- | ------------ | | md | String | - | The markdown |

Results

Type: String