Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ng-news-api
Advanced tools
An Angular 2 library for NewsAPI.
Up-to-date news headlines and metadata in JSON from 70+ popular news sites. Powered by NewsAPI.org.
You will need an API key from NewsApi.
Please look at their documentation to see how to use the API. The convenience functions provided by this module simply pass their options along as querystring parameters to the REST API, so the documentation is totally valid.
Developed By Ajani Eniola Solomon
##Install
npm i ng-news-api --save
##Add to your project
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { NewsApiModule } from 'news-api';
import { NewsApiService } from 'news-api';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
NewsApiModule.forRoot({apiKey: 'XXXXXXXXX'})
],
providers: [NewsApiService],
bootstrap: [AppComponent]
})
export class AppModule { }
Note apiKey can only be gotten from NewsApi.
##USAGE
import { Component } from '@angular/core';
import { NewsApiService } from 'news-api';
@Component({
selector: 'ld-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
data;
country = 'ng';
constructor(private service: NewsApiService) {
this.service.getNewsByHeadlines(this.country).subscribe(res => {
this.data = JSON.parse(res);
console.log(this.data);
});
}
}
##More
###getNewsByHeadlines
Request parameters:
###getEveryThing
Request parameters:
###getSource
Request parameters:
##Response object
1 status
2 totalResults
3 articles
4 source
5 author
6 title
7 description
8 url
9 urlToImage
10 publishedAt
FAQs
An Angular 2 library for NewsAPI.
We found that ng-news-api 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.