{"id":19464056,"url":"https://github.com/ova2/gulp-print-spacesavings","last_synced_at":"2026-03-27T04:46:16.792Z","repository":{"id":57258577,"uuid":"58578223","full_name":"ova2/gulp-print-spacesavings","owner":"ova2","description":"This Gulp plugin prints space savings for any Gulp compression plugin, such as gulp-uglify, gulp-clean-css, etc.","archived":false,"fork":false,"pushed_at":"2018-07-05T12:26:28.000Z","size":25,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T19:38:53.884Z","etag":null,"topics":["compressed-sizes","gulp","gulp-compression-plugins","gulp-print-spacesavings"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ova2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-11T20:24:03.000Z","updated_at":"2018-07-05T12:26:30.000Z","dependencies_parsed_at":"2022-08-28T21:41:49.462Z","dependency_job_id":null,"html_url":"https://github.com/ova2/gulp-print-spacesavings","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ova2%2Fgulp-print-spacesavings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ova2%2Fgulp-print-spacesavings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ova2%2Fgulp-print-spacesavings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ova2%2Fgulp-print-spacesavings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ova2","download_url":"https://codeload.github.com/ova2/gulp-print-spacesavings/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250782302,"owners_count":21486432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compressed-sizes","gulp","gulp-compression-plugins","gulp-print-spacesavings"],"created_at":"2024-11-10T18:13:11.352Z","updated_at":"2026-03-27T04:46:11.756Z","avatar_url":"https://github.com/ova2.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gulp-print-spacesavings\n\n[![npm version](https://badge.fury.io/js/gulp-print-spacesavings.svg)](https://badge.fury.io/js/gulp-print-spacesavings) [![Build Status](https://api.travis-ci.org/ova2/gulp-print-spacesavings.svg)](https://travis-ci.org/ova2/gulp-print-spacesavings)\n\n[![NPM](https://nodei.co/npm/gulp-print-spacesavings.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/gulp-print-spacesavings/)\n\nThis Gulp plugin prints space savings for any Gulp compression plugins, like gulp-uglify, gulp-clean-css, etc. Space savings is the reduction in size relative to the uncompressed size.\n\n__Space Savings in % = 1 - Compressed Size / Uncompressed Size__\n\nSee [Wikipedia][Wikipedia] for more information.\n\n## Install\n\n```sh\n$ npm install gulp-print-spacesavings --save-dev\n```\n\n## Usage\n\nThe plugin has zero configuration. There are two methods `init` and `print` which should be called __before__ and __after__ any Gulp compression plugin respectively. An example for `gulp-clean-css` and `gulp-uglify` is shown below.\n\n```js\nvar gulp = require('gulp');\nvar cleanCSS = require('gulp-clean-css');\nvar uglify = require('gulp-uglify');\nvar printSpaceSavings = require('gulp-print-spacesavings');\n...\n\ngulp.task('styles', function() {\n    return gulp.src('app/css/*.css')\n        .pipe(plumber())\n        .pipe(concat('all.css'))\n        .pipe(autoprefix('last 2 versions'))\n        .pipe(printSpaceSavings.init())\n        .pipe(cleanCSS())\n        .pipe(printSpaceSavings.print())\n        .pipe(gulp.dest('dist/'));\n});\n\ngulp.task('scripts', function() {\n    return gulp.src('app/js/*.js')\n        .pipe(plumber())\n        .pipe(jshint())\n        .pipe(jshint.reporter('jshint-stylish'))\n        .pipe(sourcemaps.init())\n        .pipe(printSpaceSavings.init())\n        .pipe(uglify())\n        .pipe(printSpaceSavings.print())\n        .pipe(sourcemaps.write('.'))\n        .pipe(gulp.dest('dist/'));\n});\n```\n\nThe output is displayed in the form of a table.\n\n![Screenshot](https://raw.githubusercontent.com/ova2/gulp-print-spacesavings/master/space-savings-output.png)\n\nAs you can see, the plugin also displays a footer with total uncompressed, compressed sizes and space savings if there are more than one file.\n\n[Wikipedia]: https://en.wikipedia.org/wiki/Data_compression_ratio","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fova2%2Fgulp-print-spacesavings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fova2%2Fgulp-print-spacesavings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fova2%2Fgulp-print-spacesavings/lists"}