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 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-node-express

v0.0.3

Published

A generator for Yeoman that will kick start a Node Application using Express.

Downloads

5

Readme

generator-node-express

A generator for Yeoman.

Getting Started

What is Yeoman?

From the default Yeoman Generator:

Basically, he wears a top hat, lives in your computer, and waits for you to tell him what kind of application you wish to create.

Not every new computer comes with a Yeoman pre-installed. He lives in the npm package repository. You only have to ask for him once, then he packs up and moves into your hard drive. Make sure you clean up, he likes new and shiny things.

To install Yeoman you will need to have npm (node packaged modules) installed. It comes with Node. You can install Node by using the downloader or through Brew. I like Brew. If you use Brew you'll need to add this to your .bash_profile.

homebrew=/usr/local/share/npm/bin

Here is a post on installing Node if you need it.

Once Node is installed you'll have access to npm so you can use this to install Yeoman.

$ npm install -g yo

The -g means that you are installing Yeoman globally. If you wish to uninstall Yeoman you can do so with this command.

$ npm uninstall -g yo

What's included in this generator

This generator uses some tools I find useful. Those include:

Optional tools

Installing this generator

Most generators can be installed the same way you installed Yeoman. This generator hasn't made it into the Yeoman registry yet. In order to use it you will need to download it to a directory of your choice, then cd to that directory and run this command:

$ npm link

This enables you to access the generator globally to run it. You won't need to do that once this generator makes it into the registry. If you'd like to remove this link in the future you can use this command:

$npm unlink node-express

Using this generator

With the generator installed it is time to run it. Create a directory on your computer somewhere and cd into it via the terminal. Then run:

$ yo node-express

Yeoman will ask you some questions. Answer them and it will install stuff based on your answers.

Once Yeoman is done setting up your project run this command to start working on it.

$ grunt workon

This starts the server, launches the project in your editor, opens the project in a browser, and starts watching the project for changes.

To enable LiveRelaod you'll need to install the Chrome extension.

Live Reload Chrome extension

Once installed and the project is running just turn on the Chrome Extension.

When you edit files that need the server to restart for you to see the changes, most of the time Grunt will just restart it for you. There are times when it gets stuck though. If this happens you can run this command to start it back up without reopening the project in your editor and browser.

$ grunt restart

Once your app is ready for production run this to generate a production build of your project.

$ grunt build

To test to see if the app is using the production version of the app you can shut down the server and start it again in production mode.

$ NODE_ENV=production node app.js

If it all works you are ready to deploy to Heroku. The Procfile at the root directory is for Heroku. Without it Heroku will choke. To deploy to Heroku you will need a Heorku account and the Heroku Toolbelt installed.

Once that is setup use Git to commit and then Heroku to create and deploy.

$ git init
$ git add .
$ git commit -m 'init'

Create the app

heroku create

Deploy your code

git push heroku master

To ensure that Heroku is setup to use your production settings you'll need to run this:

$ heroku config:set NODE_ENV=production

Open the project

heroku open

Things to do