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.
@smodin/justext
Advanced tools
Readme
Program jusText is a tool for removing boilerplate content, such as navigation links, headers, and footers from HTML pages. Origionally inspired from the python version at https://github.com/miso-belica/jusText .
const jusText = require("jusText");
const defaultOutput = jusText.rawHtml(htmlDoc);
// default output is the text array tagged and joined by \r\n
console.log(defaultOutput);
/* <h> This is a header\r\n<p> This is a paragraph. */
const defaultOptions = {
lengthLow: 70,
lengthHigh: 200,
stopwordsLow: 0.3,
stopwordsHigh: 0.32,
maxLinkDensity: 0.2,
maxHeadingDistance: 200,
noHeadings: false,
};
// Format options: 'default', 'unformatted', 'boilerplate', 'detailed', 'krdwrd'
const output = jusText.rawHtml(
htmlDoc,
"english",
"unformatted",
defaultOptions
);
console.log(defaultOutput);
/*
[
Paragraph {
domPath: 'html.body.div.div.h1',
xpath: '/html[1]/body[1]/div[1]/div[1]/h1[1]',
textNodes: [
'This is a header'
],
charsCountInLinks: 0,
tagsCount: 0,
classType: 'good',
heading: true,
cfClass: 'good'
},
Paragraph {
domPath: 'html.body.div.div',
xpath: '/html[1]/body[1]/div[1]/div[1]',
textNodes: [
'This is a paragraph'
],
charsCountInLinks: 0,
tagsCount: 0,
classType: 'good',
heading: false,
cfClass: 'good'
}
]*/
const output = jusText.rawHtml(htmlDoc, "english", "unformatted");
const paragraphs = output
.filter(
(paragraph) =>
paragraph.cfClass !== "short" && paragraph.classType === "good"
)
.map((paragraph) => paragraph.text());
console.log(paragraphs);
/*
[
'This is a really long paragraph.'
]
*/
const jusText = require("jusText");
const langauges = jusText.getLanguages(); // lowercase english, spanish, german, etc.
const stoplist = jusText.getStoplist("english"); // returns english stoplist, returns empty array if language isn't available
For language detection, you can use @smodin/fast-text-language-detection
for best results on Node, or any smaller alternatives like languagedetect
on the browser.
output objects for default
Don't hold context from html parsing https://github.com/miso-belica/jusText/commit/e10ce8e755f933d337e72126d1a9aa56ada9529c#diff-1c2d6d5086f226fb054ddd1823761a100ba31ec2ee282194f27385278ede1fb1
Use raw string in one segment https://github.com/miso-belica/jusText/commit/1170debf6f5937c9a706cf850bc6e4d6db2668b8#diff-1c2d6d5086f226fb054ddd1823761a100ba31ec2ee282194f27385278ede1fb1
FAQs
Program jusText is a tool for removing boilerplate content, such as navigation links, headers, and footers from HTML pages.
The npm package @smodin/justext receives a total of 2 weekly downloads. As such, @smodin/justext popularity was classified as not popular.
We found that @smodin/justext 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.