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

gulp-logwarn

v0.0.11

Published

A plugin that check if you left debug code

Downloads

60

Readme

gulp-logwarn

NPM

A configurable gulp plugin that warns you if you left debug code

Install

Use npm for install the package

npm install gulp-logwarn

How it works

In your gulpfile.js import gulp-logwarn and call it in a pipe logwarn(). If you want, you can extend the strings to be checked by passing an array of strings as argument to logwarn, something like logwarn(["console.debug","$log.info","DEBUG"]). You can also pass in an options object to change the logging level like logwarn(["console.debug"], {logLevel:"warn"}).

in the gulpfile.js

var logwarn = require('gulp-logwarn');

var strings = ["console.log","$log"];

var appJs = [
	'js/app.js',
	'js/services.js',
	'js/filters.js',
	'js/directives.js',
	'js/controllers.js'
];

gulp.task('logwarn', function(){
  gulp.src(appJs)
    .pipe(logwarn(strings));
});

...

// if you want to extend you can pass an array so...

gulp.task('logwarn', function(){
	gulp.src(appJs)
		.pipe(logwarn(['console.debug', 'console.dir']));
});

// If you want to change the log level you can pass an object like so

gulp.task('logwarn', function(){
	gulp.src(appJs)
		.pipe(logwarn(['console.debug', 'console.dir'], {
			logLevel: 'warn' // or 'info'
		}));
});

run it with gulp logwarn and it will produce as output

alt tag

Options

logLevel

Set logLevel to either 'warn' or 'info' to change what gets printed to the console. Using 'warn' will only print messages for files that contain a console.log, whereas using 'info' will print information for all files passed in regardless of whether there are any console.logs in that file.

color [optional]

You can choose to override the color of the warning or info messages with color. The colors available are:

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
  • gray
  • grey

TODO

  • tests
  • clean up the code