
Security News
/Research
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
news-api-njs
Advanced tools
An interface for Node and the newsapi.org API
You'll need an API key from News API
You can install using npm install --save news-api-njs
Then you can set up like so, where username is a default username:
var NewsApi = require('news-api-njs'),
config = require('./config');
var news = new NewsApi({
apiKey: config.apiKey
});
After this, you can use either of the following methods
Returns all possible sources where
opt = {
category: category // optional
language: top|latest|popular //optional, default is top
callback(res) {}
}
and callback is a function which receives a single object, containing the News API response and success: true|false
Returns list of articles from a given source
opt = {
category: business|entertainment|gaming|general|music|science-and-nature|sport|technology //opt, default is all
language: en|de|fr //opt, default is all
country: au|de|gb|in|it|us //opt, default is all
callback(res) {}
}
and callback is a function which receives a single object, containing the News API response and success: true|false
Alternately, you can use JavaScript promises like so
news.getArticles({
source: 'ars-technica',
sortBy: 'latest'
}).then(function(res) {
console.log(res);
}).catch(function(err) {
console.log(err);
});
You can read a full description of what options do and what the response looks like at newsapi.org, or view examples
FAQs
A Node app that hooks into newsapi.org
The npm package news-api-njs receives a total of 12 weekly downloads. As such, news-api-njs popularity was classified as not popular.
We found that news-api-njs 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
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.