
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
Demo website (demo code on gh-pages branch)
A smaller version of Markdown
~1KB gzipped
Code styled with Prettier
Why? Because Markdown parsers are large. The Commonmark JS parser is 36KB gzipped and others are of a similar size, which makes Markdown a bad format for saving, parsing, and presenting lightly formatted text in single page apps.
The idea is to create a format where the parser can be easily incorporated into single page apps so the raw string can be loaded from the backend and rendered into HTML on the frontend by the app. The format can be used for user generated content (posts, comments, etc...), and can be created using a GUI text editor or written directly.
Fast - the parser is single pass and runs in O(n) time where n is the number of characters in the string.
react-simplemark)$ yarn add simplemark
# OR
$ npm install --save simplemark
simplemark export's a single function which takes two arguments, the source string in Simplemark format and a renderer object with render functions for each type of element (Heading, Paragraph, Link, etc...).
import simplemark from 'simplemark';
const source = '# String in Simplemark format';
const renderer = {
Heading({ level, children, key }) {/*return rendered element*/},
Paragraph({ children, key }) {/*return rendered element*/},
...
};
const treeOfRenderedElements = simplemark(source, renderer);
renderer is an object with render functions for each type of element (Heading, Paragraph, etc... see list below).children an array the element's children (already rendered).key a unique id among its parent's children (as a number).href and title for links).react-simplemark).// list of all element types created by Simplemark
// all keys are required
const renderer = {
Heading({ level/*number from 1 to 6*/, children/*array*/, key/*number*/ }) {/*return rendered element*/},
Paragraph({ children, key }) {/*return rendered element*/},
Link({ href/*string*/, title/*string*/, children, key }) {/*return rendered element*/},
Emph({ children, key }) {/*return rendered element*/},
Strong({ children, key }) {/*return rendered element*/},
InlineBreak({ key }) {/*return rendered element*/},
BlockBreak({ key }) {/*return rendered element*/},
};
FAQs
A smaller version of Markdown
The npm package simplemark receives a total of 0 weekly downloads. As such, simplemark popularity was classified as not popular.
We found that simplemark 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.