
Research
Security News
Malicious npm Packages Use Telegram to Exfiltrate BullX Credentials
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
excerpt-html
Advanced tools
parses a given html text for a good excerpt.
$ npm i excerpt-html --save
var htmlCode = '<p>Hello world</p>';
var excerptHtml = require('excerpt-html');
var excerpt = excerptHtml(htmlCode);
It will either use the first found paragraph or everything up to a
<!-- more -->
You can specify a few options that modify the way the excerpt is parsed:
excerptHtml(htmlCode, {
moreRegExp: /\s*<!--\s*more\s*-->/i, // Search for the slug
stripTags: true, // Set to false to get html code
pruneLength: 140, // Amount of characters that the excerpt should contain
pruneString: '…', // Character that will be added to the pruned string
pruneSeparator: ' ', // Separator to be used to separate words
})
Note: pruneLength
and prunestring
only work when stripTags
is set to true
(default).
To make this project we detached the code of metalsmith-better-excerpts from metalsmith
.
FAQs
Get the Excerpt from a markdown file (like in jekyll or *smith)
The npm package excerpt-html receives a total of 152 weekly downloads. As such, excerpt-html popularity was classified as not popular.
We found that excerpt-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.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.
Security News
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.