How to convert markdown to HTML in NodeJS using NPM package "markdown" on Pipedream?

This topic was automatically generated from Slack. You can find the original thread here.

Hi Pipedream team.

I want to convert markdown to HTML in a NodeJS code step.

I found this NPM package markdown - npm

But I am having difficulty importing and using it.

I read in the docs about not using require and import. I have tried a few variations with no success. For example:

// To use any npm package on Pipedream, just import it
**import** markdown **from** "markdown"

export **default** defineComponent({
**async** run({ steps, $ }) {
**const** output = markdown("Hello **World**!")
**return** output
},
})

Can anyone assist?

Alternatively any NPM library that achieves Markdown to HTML I will be happy with!

Solved! Found another package called nano-markdown that functions as expected:

import nmd from "nano-markdown"

export default defineComponent({
async run({ steps, $ }) {
const output = nmd("Hello **World**!")
return output
},
})