docs: function publishNpm(pck) {
  	var pkg = null, auth = [], npm = null;
  	if (pck.commit.hasNpmToken && pck.commit.pkgPath) {
  		try {
  			npm = require('npm');
  		} catch (e) {
  			pck.rollCall.error('npm publish failed because npm module is not found (use "npm link npm")', e).resume();
  			return;
  		}
  		rbot.log.info('Publishing to npm');
  		go();
  	} else {
  		rbot.log.verbose('Skipping npm publish for ' + pck.commit.pkgPath + ' version ' + pck.commit.version);
  	}
  	function go() {
  		var pd = pck.commit.versionPkg({
  			replacer : pck.options.pkgJsonReplacer,
  			space : pck.options.pkgJsonSpace,
  			readOnly : true
  		});
  		pkg = pd.pkg;
  		if (!pkg || !pkg.author || !pkg.author.email) {
  			pck.rollCall.error('npm publish failed due to missing author.email in ' + pck.commit.pkgPath);
  		} else {
  			auth = (typeof pck.commit.npmToken === 'function' ? pck.commit.npmToken() : pck.commit.npmToken);
  			auth = typeof auth === 'string' && (auth = new Buffer(auth, 'base64').toString()) ? auth.split(':') : [];
  			if (auth.length !== 2) {
  				pck.rollCall.error('npm NPM_TOKEN is missing or invalid');
  			} else {
  				pck.rollCall.pause(function() {
  					npm.load({}, function(e) {
  						if (e) {
  							pck.rollCall.error('npm load failed', e).resume();
  						} else {
  							pck.rollCall.pause(adduser);
  						}
  					});
  				});
  			}
  		}
  	}
  	function adduser() {
  		npm.config.set('email', pkg.author.email, 'user');
  		npm.registry.adduser(pck.options.npmRegistryURL, auth[0], auth[1], pkg.author.email, aucb);
  		function aucb(e) {
  			if (e) {
  				pck.rollCall.error('npm publish failed to be authenticated', e).resume();
  			} else {
  				pck.rollCall.pause(pub);
  			}
  		}
  	}
  	function pub() {
  		var pargs = [];
  		if (pck.options.npmTag) {
  			pargs.push('--tag ' + pck.options.npmTag);
  		}
  		rbot.log.info('npm publish ' + pargs.join(' '));
  		// switch to the master branch so publish will pickup the right version
  		pck.command.chkoutCmd(pck.commit.branch);
  		npm.commands.publish(pargs, function(e) {
  			if (e) {
  				pck.rollCall.error('npm publish failed', e).resume();
  			} else {
  				pck.rollCall.pause(postPub);
  			}
  		});
  		function postPub() {
  			pck.command.chkoutRun(null, function() {
  				rbot.log.verbose('npm publish complete');
  				pck.rollCall.resume();
  			});
  		}
  	}
  }