This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

lib-hn
TypeScript icon, indicating that this package has built-in type declarations

0.8.0 • Public • Published

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))

Package Sidebar

Install

npm i lib-hn

Weekly Downloads

0

Version

0.8.0

License

GPL-3.0-only

Unpacked Size

170 kB

Total Files

136

Last publish

Collaborators

  • alcha