npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

yc-api

v2.0.3

Published

This is a wrapper module around the Hacker News API. You can filter the news in order to show you only the stories with a minimum score.

Readme

What is it?

This is a wrapper module around the Hacker News API. You can filter the news in order to show you only the stories with a minimum score.

async/awaitg support

Tha last version of this library support async/await.

Installation

As simple as npm install yc-api

Usages

Import the module with const yc-api = require('yc-api').

get_top_stories_id()

This take the top stories (IDs) from YC and return them.

get_story(url)

Takes an url as argument and return a JSON object containing the story.

The returned object looks like this:

{
      "by" : "dhouston",
      "descendants" : 71,
      "id" : 8863,
      "kids" : [ 8952, 9224, 8917, 8884, 8887, 8943, 8869, 8958, 9005, 9671, 8940, 9067, 8908, 9055, 8865, 8881, 8872, 8873, 8955, 10403, 8903, 8928, 9125, 8998, 8901, 8902, 8907, 8894, 8878, 8870, 8980, 8934, 8876 ],
      "score" : 111,
      "time" : 1175714200,
      "title" : "My YC app: Dropbox - Throw away your USB drive",
      "type" : "story",
      "url" : "http://www.getdropbox.com/u/2/screencast.html"
  }

get_stories()

Return an array of JSON object containing the stories.

stories_with_score(score)

Same as get_stories but return into the object only the stories with the minimum score of score.

Example

stories_with_score(200).then(stories => console.log(stories));

Example

const YC = require("yc-api");

const api = new YC();

api.stories_with_score(500).then(stories => console.log(stories));


// using async
const stories = await api.stories_with_score(200);
console.log(stories)```