Gathering detailed insights and metrics for gulp-uglify
Gathering detailed insights and metrics for gulp-uglify
Gathering detailed insights and metrics for gulp-uglify
Gathering detailed insights and metrics for gulp-uglify
npm install gulp-uglify
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1,226 Stars
198 Commits
154 Forks
31 Watching
1 Branches
22 Contributors
Updated on 21 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
5.4%
67,410
Compared to previous day
Last week
3%
381,312
Compared to previous week
Last month
9.9%
1,530,799
Compared to previous month
Last year
-12.3%
16,426,644
Compared to previous year
10
Minify JavaScript with UglifyJS3.
Install package with NPM and add it to your development dependencies:
npm install --save-dev gulp-uglify
1var gulp = require('gulp'); 2var uglify = require('gulp-uglify'); 3var pipeline = require('readable-stream').pipeline; 4 5gulp.task('compress', function () { 6 return pipeline( 7 gulp.src('lib/*.js'), 8 uglify(), 9 gulp.dest('dist') 10 ); 11});
To help properly handle error conditions with Node streams, this project
recommends the use of
pipeline
,
from readable-stream
.
Most of the minify options from the UglifyJS API are supported. There are a few exceptions:
sourceMap
option must not be set, as it will be automatically configured
based on your Gulp configuration. See the documentation for Gulp sourcemaps.gulp-uglify
emits an 'error' event if it is unable to minify a specific file.
The GulpUglifyError constructor is exported by this plugin for instanceof
checks.
It contains the following properties:
fileName
: The full file path for the file being minified.cause
: The original UglifyJS error, if available.Most UglifyJS error messages have the following properties:
message
(or msg
)filename
line
To see useful error messages, see Why Use Pipeline?.
By default, gulp-uglify
uses the version of UglifyJS installed as a dependency.
It's possible to configure the use of a different version using the "composer" entry point.
1var uglifyjs = require('uglify-js'); // can be a git checkout 2 // or another module (such as `uglify-es` for ES6 support) 3var composer = require('gulp-uglify/composer'); 4var pump = require('pump'); 5 6var minify = composer(uglifyjs, console); 7 8gulp.task('compress', function (cb) { 9 // the same options as described above 10 var options = {}; 11 12 pump([ 13 gulp.src('lib/*.js'), 14 minify(options), 15 gulp.dest('dist') 16 ], 17 cb 18 ); 19});
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More