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

saymedia

v0.2.0

Published

Coding challenge for front end engineers.

Readme

Say Media Coding challenge

Jesse Mull
04/11/2017

Overview

My solution to the Say Media coding challenge uses simple angular boilerplate and a dynamic single page web application. The user can navigate and interact with the challenges using the tabs at the top of the page. All forms in the application validate user input. Starting the application fires up an http server listening on http://localhost:8000/

Installation

Installation option 1 - NPM

This coding challenge is published as an NPM module. To install and fire up the application:

npm init
npm install saymedia
cd node_modules/saymedia
npm start

Navigate a browser to http://localhost:8000/.

Installation option 2 - GitHub

This coding challenge is also hosted on my github account. To install and fire up the application:

git clone https://github.com/jessemull/SayMedia
cd SayMedia
bower install
npm start

Navigate a browser to http://localhost:8000/.

Installation option 3 - Google Drive

I sent a link in my reply e-mail to a Google Drive folder containing a zip file with the solution.

Challenge 1: Primes

This is an implementation in Javascript of the Sieve of Eratosthenes. For our purposes here the valid range for the number of primes to count is 1 - 10,000 but the algorithm can print out many more primes efficiently. The output lists the number of primes to count and prints an array holding all the prime numbers. See the wiki page for the pseudo code.

Challenge 2: Block Quotes

Here the user can toggle back and forth between block quotes and paragraphs in a content editable div element. Angular wraps the window and document objects in an injectable service but this algorithm would also work with vanilla Javascript. The inner text from the div element is retrieved. The text is split on new lines. The editable div is cleared and each new block quote elements for each paragraph are appended as children of the editable div element.

Challenge 3: Sum Pairs

For challenge three the user can input a list of comma separated values and a target or generate a random array and target. To process the list of values the text from the input field is split on a comma then stored in an array. The find pairs algorithm does a single pass of the values. For each value the function checks if the matching number for the pair has already been stored in a set. If it is the pair is added to the output array. If complimentary number is missing the value is added to the set. The output prints the list of input values and the pairs whose sum is equal to the target.

Challenge 4: Cargo Allocation

The solution to this challenge uses a car service to create an output string holding the allocation. The car service holds a car object that contains the type of car, the capacity of the car and the quantity of cars. New car objects are instantiated in the module controller rather than the service so that it can be recycled for use by any module. The allocate method takes a list of car objects and a weight, iterates over the array of cars and continues to add tonnage to each car until all cargo has been allocated or the allocation space runs out. The allocation string is then displayed as output in the challenge four view.