{"id":19753227,"url":"https://github.com/philmander/gulp-warn-size","last_synced_at":"2025-02-28T01:23:22.095Z","repository":{"id":57259455,"uuid":"55060295","full_name":"philmander/gulp-warn-size","owner":"philmander","description":"Gulp plugin that warns when a file exceeds a given size limit\"","archived":false,"fork":false,"pushed_at":"2016-03-30T14:42:30.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-10T21:48:55.264Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philmander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-30T12:15:59.000Z","updated_at":"2016-03-30T12:17:48.000Z","dependencies_parsed_at":"2022-08-25T03:53:52.334Z","dependency_job_id":null,"html_url":"https://github.com/philmander/gulp-warn-size","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/philmander%2Fgulp-warn-size","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philmander%2Fgulp-warn-size/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philmander%2Fgulp-warn-size/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philmander%2Fgulp-warn-size/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philmander","download_url":"https://codeload.github.com/philmander/gulp-warn-size/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241084572,"owners_count":19907132,"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":[],"created_at":"2024-11-12T02:52:11.895Z","updated_at":"2025-02-28T01:23:22.067Z","avatar_url":"https://github.com/philmander.png","language":"JavaScript","readme":"# gulp-warn-size\n\n\u003e Warns if a file in a stream exceeds a given limit\n\n\n## Install\n\n```\n$ npm install --save-dev gulp-warn-size\n```\n\n\n## Usage\n\n```js\nconst gulp = require('gulp');\nconst size = require('gulp-warn-size');\n\ngulp.task('default', () =\u003e\n\tgulp.src('fixture.js')\n\t\t.pipe(warn-size(2048)) //should not exceed 2kb\n\t\t.on('error', () =\u003e process.exit(1))\n\t\t.pipe(gulp.dest('dist'))\n);\n```\n\n`gulp-warn-size` does not display sizes. Use [gulp-size](https://github.com/sindresorhus/gulp-size) for this.\n\n\n## API\n\n### warn-size(limit)\n\nType: `number`\u003cbr\u003e\nRequired\n\nThe file size limit in bytes. Negative values will be ignored. Other values will cause the plugin to fail.\n\n### warn-size(options)\n\n#### options\n\n##### limit\n\nType: `number`\u003cbr\u003e\nRequired\n\nSame as above\n\n##### errorOnFail\n\nType: `boolean`\u003cbr\u003e\nDefault: `true`\n\nEmits an error from the stream if a file exceeds the given limit. Otherwise, just a warning will be logged to the console\n\n##### filter\n\nType: `RegExp`\u003cbr\u003e\nDefault: /.*/\n\nOnly applies file size checking to files which match this pattern. E.g.\n\n```\ngulp.src('src/**/*')\n    .pipe(warn-size({\n        limit: 2048,\n        filter: /\\.js$/ //only check JS files\n    }))\n    .pipe(gulp.dest('dist'))\n```\n\n##### pretty\n\nType: `boolean`\u003cbr\u003e\nDefault: true\n\nDisplays prettified size: `1337 B` → `1.34 kB`.\n\n## License\n\nMIT. Phil Mander. \n\nAdapted from gulp-size","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilmander%2Fgulp-warn-size","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilmander%2Fgulp-warn-size","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilmander%2Fgulp-warn-size/lists"}