Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
excerpt-html
Advanced tools
Readme
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 147 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.