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

campsite

v1.5.0

Published

A command-line interface for checking available campsites

Readme

CampSite

CampSite is a Command Line Interface application that parses a local JSON data file and returns the available campsites for the dates specified within.

Running CampSite

CampSite is easy to run! Open a new Terminal process, navigate to the directory where your JSON file is located, and run npx campsite. After installation, enter your name and choose the desired file using the selection tool. After a few moments, CampSite will let you know what's available.


Approach to problem solving

At the highest level, CampSite matches campsites with their reservations and lets the user know which sites are available for the requested dates. It does so using the following approach:

  • Take in the submitted data.
  • Look through the campsites.
  • Associate each campsite with its reservations, if they exist.
  • Check for unreserved campsites.
  • Compare the given search dates to any existing reservations and check whether the dates overlap or do not leave a sufficient gap.
  • Return the campsites which are not reserved and/or do not present any conflicts.

The core function is built using a functional approach to avoid mutation of data, simplify testing, and reduce space complexity.

Assumptions and considerations

The program is built around a few assumptions drawn from the supplied data:

  • The dates specified in the provided JSON file refer to nights, rather than days. This is evidenced by a reservation that both begins and ends on June 1, 2018.
  • Because of that, searching for dates that are immediately adjacent to existing reservations is acceptable.
  • There is no restriction on the minimum length of a reservation.
  • Users may have an open-ended itinerary; they may wish to search for only a start date or only an end date, or no specific dates at all.
  • Therefore, the user should only be prevented from viewing campsites that definitively could not accommodate their itinerary. In these cases, the application could be structured as to present the user with a calendar of available dates for the site they choose to view.

Extensibility

Although CampSite defaults to check for single-night gaps, it also includes an optional argument to allow for other minimum gaps. This should allow for some extensibility with additional development, and receives several tests to check for basic functionality.

Testing

The test suite strives to achieve thorough coverage using both unit and integration tests. As the bulk of the program's logic occurs in the conflicts method, it accordingly receives the greatest amount of testing. After ensuring that each inner method is returning its expected values, the outer method receives several integration tests.