Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@types/marked
Advanced tools
Stub TypeScript definitions entry for marked, which provides its own types definitions
@types/marked provides TypeScript type definitions for the 'marked' library, which is a fast, lightweight markdown parser and compiler. It allows developers to use 'marked' with TypeScript, ensuring type safety and better development experience.
Basic Markdown Parsing
This feature allows you to convert a markdown string into HTML. The code sample demonstrates how to use 'marked' to parse a simple markdown string and convert it to HTML.
const marked = require('marked');
const markdownString = '# Hello World';
const htmlString = marked(markdownString);
console.log(htmlString);
Custom Renderer
This feature allows you to customize the rendering of markdown elements. The code sample shows how to create a custom renderer that changes the color of headings to red.
const marked = require('marked');
const renderer = new marked.Renderer();
renderer.heading = function (text, level) {
return `<h${level} style="color: red;">${text}</h${level}>`;
};
const markdownString = '# Hello World';
const htmlString = marked(markdownString, { renderer: renderer });
console.log(htmlString);
Synchronous and Asynchronous Parsing
This feature allows you to parse markdown both synchronously and asynchronously. The code sample demonstrates both methods of parsing a markdown string.
const marked = require('marked');
const markdownString = '# Hello World';
// Synchronous
const htmlStringSync = marked(markdownString);
console.log(htmlStringSync);
// Asynchronous
marked(markdownString, (err, htmlStringAsync) => {
if (err) throw err;
console.log(htmlStringAsync);
});
Showdown is another markdown to HTML converter. It is similar to 'marked' in terms of functionality but offers additional features like extensions and more customization options. Showdown also has a TypeScript definition file available.
Markdown-it is a markdown parser that is designed to be pluggable and offers high performance. It provides more extensibility compared to 'marked' and has a rich plugin ecosystem. It also supports TypeScript through a separate type definition package.
Remark is a markdown processor powered by plugins. It is highly extensible and can be used to parse, transform, and compile markdown. Remark offers more flexibility and control over the markdown processing pipeline compared to 'marked'.
This is a stub types definition for @types/marked (https://marked.js.org).
marked provides its own type definitions, so you don't need @types/marked installed!
FAQs
Stub TypeScript definitions entry for marked, which provides its own types definitions
The npm package @types/marked receives a total of 558,357 weekly downloads. As such, @types/marked popularity was classified as popular.
We found that @types/marked 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.