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

ghint

v0.8.7

Published

A CLI for JSHint

Readme

node-jshint

A command line interface and npm package for jshint.

Install

To use jshint from any location (for npm v1.x) you need to install using the global (-g) flag.

npm install -g jshint

Usage

jshint -h

You can also require JSHint itself as a module.

var jshint = require('jshint');

Note: If you are using npm v1.x be sure to install jshint locally (without the -g flag) or link it globally.

Text Editor Plugins

  • gedit-node-jshint - Simply use CTRL+J in gedit to run JSHint using node-jshint.
  • vim syntastic - Run node-jshint at each file save.
  • sublime-jshint - F7 or command-B on any .js file. F4 next error line,column. shift-F4 previous error line,column.

Custom Reporters

Specify a custom reporter module (see example/reporter.js).

--reporter path/to/reporter.js

Use a jslint compatible xml reporter.

--jslint-reporter

Show additional non-error data generated by jshint (unused globals etc).

--show-non-errors

Configuration Options

Note: This behavior described below is very different from versions prior to 0.6.

The CLI uses the default options that come with JSHint.

Only one extra option is unique to node-jshint: extraglobals allows you to define an object of globals that get ignored for every file. To see an example you can look at how whitelisted globals are defined in the jshint code

To have your own configuration apply, there are several methods you can use:

Specify Manually

Setting the --config=/path/to/your/config command line option to specify your own configuration file outside of the directory tree for your project.

Within your Project's Directory Tree

When the CLI is called, and a configuration file isn't specified already, node-jshint will attempt to locate one for you starting in pwd. (or "present working directory") If this does not yield a .jshintrc file, it will move one level up (..) the directory tree all the way up to the filesystem root. If a file is found, it stops immediately and uses that set of configuration.

This setup allows you to set up one configuration file for your entire project. (place it in the root folder) As long as you run jshint from anywhere within your project directory tree, the same configuration file will be used.

Home Directory

If all the methods above do not yield a .jshintrc to use, the last place that will be checked is your user's $HOME directory.

File Extensions

Default extension for files is ".js". If you want to use JSHint with other file extensions (.json), you need to pass this extra extension as an option :

--extra-ext .json

Ignoring Files and Directories

If there is a .jshintignore file in your project's directory tree, (also provided you run jshint from within your project's directory) then any directories or files specified will be skipped over. (behaves just like a .gitignore file)

Note: Pattern matching uses minimatch, with the nocase option. When there is no match, it performs a left side match (when no forward slashes present and path is a directory).

Installing dependencies for development

./configure

Build Commands

jake -T

Project Guidelines

  • All tests are passing.
  • No (new) JSHint errors are introduced.