
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@inyur/markdown-to-html
Advanced tools
npm i -S @inyur/markdown-to-html
import md2html from '@inyur/markdown-to-html';
// Variant 1
const someMdFileContent = require('fs').readFileSync('./some.md', 'utf8');
const html = await md2html(someMdFileContent);
// Variant 2
// Internaly md2html has promise resolver if promise found and
// has object default getter.
const someMdFileContentPromised = import('./some.md')
.then(module=> module.defult);
const html = await md2html(someMdFileContentPromised);
// Or This simplified works too
const someMdFileContentPromised = import('./some.md');
const html = await md2html(someMdFileContentPromised);
// Or This simplified works too
const html = await md2html(import('./some.md'));
In general cases markdown-to-html return html string, except this called with special parameter extended
Advanced usage:
const options = {
}
const html = await md2html('Md text or promise or esmodule', options);
this is object of some props (see next)
Can be Array of (Objects of Strings or Functions) Can be Array of Functions Can be Object of Strings or Functions Can be Function
const options = {
links: [{
alfaUrl: 'https://alfa.net',
betaUrl: (url, node) => {
if (url.host !== 'internal.site') {
node.properties.target = '_blank'
}
return 'https://beta.com'
},
}]
}
Can be Object
const options = {
variables: {
someTextVariable: 'Some Value'
}
}
const html = await md2html('Md text ${someTextVariable}', options);
markdown-to-html return Object of:
const {
markdown, // initial markdown source
title, // returns if splitTitle prop is true
template, // Handlebars template, useful for reuse template
html, // Compiled template as === template(variables)
data, // Returned data from frontMatter
headings, // Returned H1-6 structure
toString, // Function for usage as text === toString() { return template(variables); }
} = await md2html('Md text or promise or esmodule', options);
Boolean, default false In extended version returned object with html without title and title prop.
FAQs
```bash npm i -S @inyur/markdown-to-html ```
The npm package @inyur/markdown-to-html receives a total of 2 weekly downloads. As such, @inyur/markdown-to-html popularity was classified as not popular.
We found that @inyur/markdown-to-html demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.