Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vladholubiev/aws-news-api-client

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vladholubiev/aws-news-api-client

AWS News API Client with retry behavior

  • 2.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

aws-news-api-client CircleCI

AWS News API Client with retry behavior

Install

$ yarn add @vladholubiev/aws-news-api-client

Usage

const {
  fetchPageOfNews,
  getTotalPagesCount,
  getYearsWithData,
} = require('@vladholubiev/aws-news-api-client');

// fetches 100 news from 2023
// page numbering starts from 1
await fetchPageOfNews({year: 2023, pageNumber: 1, pageSize: 100});

// returns total number of pages for 2023, useful for iteration with the fetchPageOfNews method
await getTotalPagesCount({year: 2023, pageSize: 100});

getYearsWithData(); // returns array of years with news from 2004 till now

fetchPageOfNews has retry logic, so it will retry a request for up to 5 times.

Note: API doesn't return more than 100th page. In 2022 there were 2103 news. So if your page size is 100, you will get 21 pages. Don't select page size < 22, otherwise you'll not get all the news.

Publish

$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags

License

MIT

FAQs

Package last updated on 09 Jun 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc