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

learn-travis

v1.0.0

Published

Simple nodejs, travis and grunt demo

Readme

Learn Travis Build Status Dependencies

Our quick guide to Travis CI (Continuous Integration) for complete beginners

![Toilet Roll Blocks Seat FAIL](https://raw.github.com/dwyl/learn-travis/master/images/Roll-Blocks-Toilet-Seat.jpg "Toilet Roll Blocks Seat from Closing. Fail!"")

Test Early, Test Often to spot "integration issues" before its too late ...

Continuous integration is a software development process
in which all development work is integrated at a predefined time
or event and the resulting work is automatically tested and built.
The idea is that development errors are identified very early in the process.

If you are completely new to Continuous Integration (CI) I recommend reading the CI Wikipedia Article and Martin Fowler's Article on CI. Note: Both of these are quite text-heavy but contain all the info you need. Read them! If you have any questions, ask!

The key advantages of Travis:

  • Nothing to Install (Cloud Based ... Not Java!)
  • Free Both to Use and Open Source (MIT License) see: http://about.travis-ci.org/
  • Integrates nicely with GitHub (without any developer effort!)

I've used Jenkins/Hudson CI in the past @groupon, but found the learning curve a bit steep for new developers. Travis by contrast has a much shallower learning curve!

Getting Started

Following the Travis Getting Started guide:

Visit: https://travis-ci.org/ and click "Sign in with GitHub" no "registration" required.

Travis Login with GitHub

You will be re-directed to GitHub where you need to click "Authorize application"

Authorize Travis at GitHub

Note: If you ever want to stop Travis accessing to your GitHub account, simply visit: https://github.com/settings/applications and click on Revoke.

Once you have allowed access you will be taken back to Travis where you will need to enable a specific Git Repository. You can also do this in your Travis Profile: https://travis-ci.org/profile

Enable Repo in Travis

Create The Project Files

Now back in your text editor create a few new files:

vi .travis.yml
language: node_js
node_js:
  - 0.12

.travis.yml is a basic Travis configuration file that tells travis-ci our application runs on node.js and we want them to test it using a specific version of node. (the file needs to be in the root of your git repository)

Define The Test

In your package.json file, define the test you want Travis-CI to run:

vi package.json
{
  "name": "learn-travis",
  "description": "Simple nodejs, travis and grunt demo",
  "author": "your name here :-)",
  "version": "0.0.1",
  "devDependencies": {
    "jshint": "^2.6.0"
  },
  "scripts": {
    "test": "./node_modules/jshint/bin/jshint hello.js"
  }
}

The package.json file is a standard node.js package file with one extra element on the end, the "scripts" property identifies a "test" command:

npm install jshint --save-dev

you can run this command locally by typing npm test in your terminal or in our case, we ask Travis to run it on the travis-ci.org servers.

vi hello.js
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello Travis!\n') // this will FAIL travis ci lint
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');

Watch it Fail

Commit all the files you just created and push them to github. Travis will automatically scan your repository and pickup the .travis.yml file which informs travis this is a node.js project/app next travis will look for a package.json file and scan for a scripts entry (specifically the test one) Travis will download all the modules listed in your devDependencies and attempt to run your test script npm test

In our case we are only asking travis to lint the hello.js file. and since the file was missing a semi-colon on the 4th line above, it will fail the lint and thus the build process fails!

Travis Build Failing

Travis Build Failing Error Message

On line 343 we are missing a semi-colon.

Correct Code To Pass Build

Simply add the simi-colon to the 4th line of hello.js and commit your changes:

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello Travis!\n'); // build should pass now!
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');

Build Status

Travis Build Passing


Todo: create a more realistic test that does something useful. [pull requests welcome!]


Notes:

General CI Background Reading

  • Continuous Integration Wikipedia Article: http://en.wikipedia.org/wiki/Continuous_integration
  • Martin Fowler's Article on CI: http://www.martinfowler.com/articles/continuousIntegration.html
  • CI Beginners Guide Video: https://vimeo.com/19596466

Travis Specific

  • Travis Getting Started: http://about.travis-ci.org/docs/user/getting-started/
  • Build Podcast Ep.32 (Travis) Video: http://build-podcast.com/travisci/
  • @sayanee_'s Build Podcast GitHub: https://github.com/sayanee/build-podcast/tree/master/032-travisci

Further Reading

  • Comparison of CI Software: http://en.wikipedia.org/wiki/Comparison_of_continuous_integration_software
  • Great Book on CI: http://www.amazon.com/Continuous-Integration-Improving-Software-Reducing/dp/0321336380/
  • Jenkins/Hudson CI: http://jenkins-ci.org/
  • Lars Vogel Jenkins Tutorial: http://www.vogella.com/articles/Jenkins/article.html
  • This is why I avoid Java: http://www.cvedetails.com/vulnerability-list/vendor_id-5/product_id-1526/ by comparison, Node.js: http://www.cvedetails.com/vulnerability-list/vendor_id-12113/product_id-22804/opginf-1/Nodejs-Nodejs.html

Future

  • ALL The Diagrams on Google Image Search for Continuous Integration are terrible! https://www.google.com/search?q=continuous+integration&source=lnms&tbm=isch I either need to make time to draw one or ask someone to do one.