├── .gitignore ├── .travis.yml ├── index.js ├── package.json └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /*.log 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.7 5 | - 0.8 6 | - 0.9 7 | - 0.10 8 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var map = require('map-stream'); 3 | var es = require('event-stream'); 4 | 5 | module.exports = function() { 6 | return es.map(function (file, cb) { 7 | var search = /console.((log|debug|info|warn|error|assert|dir|dirxml|trace|group|groupEnd|time|timeEnd|profile|profileEnd|count)(.*);?)(.*);i?/g; 8 | file.contents = new Buffer(file.contents.toString().replace(search,'')); 9 | cb(null,file); 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gulp-removelogs", 3 | "version": "0.1.0", 4 | "description": "gulp plugin to remove console.logs", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/hemanth/gulp-removelogs" 12 | }, 13 | "keywords": [ 14 | "log", 15 | "console", 16 | "gulpplugin" 17 | ], 18 | "dependencies": { 19 | "event-stream": "~3.1.7", 20 | "map-stream": "~0.0.5" 21 | }, 22 | "author": "Hemanth.HM", 23 | "license": "BSD-2-Clause", 24 | "bugs": { 25 | "url": "https://github.com/hemanth/gulp-removelogs/issues" 26 | }, 27 | "homepage": "https://github.com/hemanth/gulp-removelogs" 28 | } 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # This plugin is depricated in favour of [gulp-strip-debug](https://www.npmjs.org/package/gulp-strip-debug) 2 | 3 | 4 | 5 | # gulp-removelogs [![NPM version][npm-image]][npm-url] [![Build status][travis-image]][travis-url] 6 | > Strip of logs from a file. 7 | 8 | ## Usage 9 | 10 | First, install `gulp-removelogs` as a development dependency: 11 | 12 | ```shell 13 | npm install --save-dev gulp-removelogs 14 | ``` 15 | 16 | Then, add it to your `gulpfile.js`: 17 | 18 | ```javascript 19 | var removeLogs = require('gulp-removelogs'); 20 | 21 | gulp.task('default', function(){ 22 | gulp.src('index.js') 23 | .pipe(removeLogs()) 24 | .pipe(gulp.dest('build/index.js')); 25 | }); 26 | ``` 27 | The above with strip of all console realated logs from index.js 28 | 29 | [travis-url]: http://travis-ci.org/hemanth/gulp-removelogs 30 | [travis-image]: https://secure.travis-ci.org/lazd/gulp-removelogs.png?branch=master 31 | [npm-url]: https://npmjs.org/package/gulp-removelogs 32 | [npm-image]: https://badge.fury.io/js/gulp-repl.png 33 | --------------------------------------------------------------------------------