Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
A lightweight JavaScript library for basic text analysis operations like summarization, sentiment analysis, keyword extraction, and classification.
TextMagic JS is a lightweight JavaScript library designed to perform basic text analysis operations such as summarization, sentiment analysis, keyword extraction, and text classification. It utilizes simple algorithms such as Naive Bayes and TF-IDF for these tasks.
To install the library, run the following command:
npm install textmagic-js
Summarize the text by extracting the most relevant sentences.
const TextAnalyzer = require('textmagic-js');
const analyzer = new TextAnalyzer();
const text = "This is the first sentence. This is the second sentence. This is the third sentence.";
console.log(analyzer.summarize(text, 2)); // Will return the top 2 sentences.
Analyzes the sentiment of the given text and returns the sentiment as positive, negative, or neutral.
const sentiment = analyzer.sentimentAnalysis("I love this! It makes me happy.");
console.log(sentiment); // Will return 'positive'.
Extracts the top 5 keywords from the given text.
const keywords = analyzer.extractKeywords("Artificial Intelligence is a branch of computer science.");
console.log(keywords); // Will return an array of the most frequent words.
Classifies the text into predefined categories such as "news", "sports", or "entertainment" using Naive Bayes classifier.
const category = analyzer.classify("The football match was exciting.");
console.log(category); // Will return the predicted category (e.g., 'sports').
sentiment
package to analyze the sentiment of the text.This library uses basic algorithms and techniques, making it suitable for lightweight applications. However, it may not provide the accuracy of more advanced NLP models powered by machine learning.
FAQs
A lightweight JavaScript library for basic text analysis operations like summarization, sentiment analysis, keyword extraction, and classification.
The npm package textmagic receives a total of 0 weekly downloads. As such, textmagic popularity was classified as not popular.
We found that textmagic demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.