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

lib-hn

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lib-hn

A library for interacting with the Hacker News API.

  • 0.6.0
  • npm
  • Socket score

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

Drone (self-hosted) NPM License NPM Version Snyk Vulnerabilities for npm package

code style: prettier Discord More-Social-Links

Lib-HN

This project (Lib-HN) is a lightweight package/library for interacting with the Hacker News API and uses the Axios library under the hood to handle the actual sending/receiving of requests.

Basic Usage

The following code block is a one way of using the library but there are more examples available in the ./examples directory.

import { LibHN } from 'lib-hn'

const client = new LibHN({ baseUrl: 'url-goes-here', version: 'v0' })

async function main() {
  try {
    const topStoryIds = await client.getStories('top')

    return topStoryIds
  } catch (err) {
    console.error('Error received when attempting to execute main() method...')
    throw err
  }
}

main()
  .then(res => {
    console.log(res)
    console.log('Execution completed successfully.')
  })
  .catch(err => console.error(err))

Keywords

FAQs

Package last updated on 28 Jan 2023

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