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 🙏

© 2025 – Pkg Stats / Ryan Hefner

generator-courier

v0.1.3

Published

A generator for Yeoman

Downloads

10

Readme

#generator-courier

A Yeoman generator for data journalists, map-makers and others.

Background

This is generator is used at the Waterloo-Cedar Falls Courier to scaffold out simple, one-page apps. Here's an example of a map and here's an example of a single-page app that were created with this generator.

Included are several options for making maps with Leaflet. For instance, you can use JSON files with latitude and longitude coordinates in them to create a map. This generator will also scaffold out a map that uses GeoJSON file(s). You are also given the options for using Tabletop to pull data from a Google spreadsheet or Handlebars to template the data.

You can also create a searchable database using DataTables.

NOTE: This generator uses Require.JS, so it's probably best to familiarize yourself with that library before using this generator. Also, you can use SASS with your projects if you like.

Install

To install the generator, run this command on your command line:

npm install -g generator-courier

Usage

You can then start the generator by running:

yo courier

Prebuilt options

Once you run this command, Yeoman will ask you several questions related to your project. The first set of questions will ask you the basics on the project. Some of this information will become metadata for Twitter and Facebook. It will then ask you if you want to create a map or not.

Depending on what you choose, you will be asked more questions. If you decide to create a map, you will be asked about how you want the data formatted. For instance, you can use GeoJSON file(s) and create a drop-down menu to filter through GeoJSON properties (example:). You will also be asked a few questions about how you want the map to look. You can use circle markers, large popups boxes with your markers (example:) and marker clusters courtesy of the Leafet cluster plugin.

If you decide you don't want to create a map, you will be given fewer options.

Testing

Once you have selected your options, you can run your the project locally:

grunt app

A prebuilt project will now be created in the 'app' folder. Sample data and all the necessary dependencies will also be created. You can then delete the data and replace it with your own. If you are using Tabletop, you can switch out the sample spreadsheet key in JS file with your own key.

This generator uses live reload, so when you make changes to your files, the project be automatically re-loaded on your local server.

If you are using SASS, the .scss files will be automatically compiled to CSS files whenever you re-save your project. If you are having trouble with compiling your CSS files, you can run:

grunt server

Getting the project ready

When you are ready to deploy your app, run this command:

grunt public

A new folder will be created that ends in "-public". All your CSS and JS files will be combined and minified into that folder. All other files (like image files, for instance) will be copied to that folder as well. A local server will open your index.html file so you can make sure everything looks right.

Deploying

We use an SFTP server to deploy our apps. If you want to do the same, change the sftp-deploy options in your Gruntfile. Then add a .ftppass file with your user/pass information.

Courier stuff

The generator assumes you are deploying to the Courier's server. You will want to change all references to "http://wcfcourier.com/..." in the index.html page.

A Courier logo is also used with the app, which you will want to delete or replace.

Also, the tweet button references our Twitter handle, which you will want to change.

License

MIT License