{"id":20614738,"url":"https://github.com/dashed/sizeof-loader","last_synced_at":"2025-09-01T09:32:30.017Z","repository":{"id":22350121,"uuid":"95875753","full_name":"dashed/sizeof-loader","owner":"dashed","description":"Webpack loader that works like url-loader (or file-loader) but with extracted information such as image dimensions and file-size.","archived":false,"fork":false,"pushed_at":"2021-11-01T13:32:34.000Z","size":649,"stargazers_count":20,"open_issues_count":15,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T16:18:07.054Z","etag":null,"topics":["image-dimensions","loader","sizeof","webpack","webpack-loader"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dashed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-30T10:05:29.000Z","updated_at":"2025-08-01T04:34:36.000Z","dependencies_parsed_at":"2022-07-25T13:17:01.097Z","dependency_job_id":null,"html_url":"https://github.com/dashed/sizeof-loader","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/dashed/sizeof-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashed%2Fsizeof-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashed%2Fsizeof-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashed%2Fsizeof-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashed%2Fsizeof-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dashed","download_url":"https://codeload.github.com/dashed/sizeof-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashed%2Fsizeof-loader/sbom","scorecard":{"id":323703,"data":{"date":"2025-08-11","repo":{"name":"github.com/dashed/sizeof-loader","commit":"091f8c79763e534ee47380ba08ff2551ae8ef33e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node.js.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/1 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/dashed/sizeof-loader/node.js.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/dashed/sizeof-loader/node.js.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"42 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T01:58:32.002Z","repository_id":22350121,"created_at":"2025-08-18T01:58:32.002Z","updated_at":"2025-08-18T01:58:32.002Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273100057,"owners_count":25045697,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["image-dimensions","loader","sizeof","webpack","webpack-loader"],"created_at":"2024-11-16T11:13:29.579Z","updated_at":"2025-09-01T09:32:29.970Z","avatar_url":"https://github.com/dashed.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"sizeof-loader [![Build Status](https://github.com/dashed/sizeof-loader/workflows/Node.js/badge.svg)](https://github.com/dashed/sizeof-loader/actions?workflow=Node.js) [![npm version](https://img.shields.io/npm/v/sizeof-loader.svg?style=flat)](https://www.npmjs.com/package/sizeof-loader)\n==============\n\n\u003e Webpack loader that works like [`url-loader`](https://github.com/webpack-contrib/url-loader) (or [`file-loader`](https://github.com/webpack-contrib/file-loader)) but with extracted information such as image dimensions and file-size.\n\n## Install\n\n```sh\nyarn add --dev sizeof-loader\n# or\nnpm install --save-dev sizeof-loader\n```\n\n## Usage\n\n```js\n// webpack.confg.js\n\n// ...\n\nmodule.exports = {\n    module: {\n        rules: [\n            {\n                test: [/\\.bmp$/, /\\.gif$/, /\\.jpe?g$/, /\\.png$/],\n                use: [\n                    {\n                        loader: \"sizeof-loader\",\n\n                        options: {\n                            // default is false\n                            useFileLoader: false,\n\n                            // any options will be passed to file-loader or url-loader\n                            limit: 10000,\n                            name: \"static/media/[name].[hash:8].[ext]\"\n                        }\n                    }\n                ]\n            }\n        ]\n\n        // ...\n    }\n\n    // ...\n};\n\n```\n\n```js\n// path/to/amazing/app/src/components/logo.js\n\nimport logo_img from \"images/logo.png\";\n\n// logo_img is:\n{\n\n    // Output emitted from either:\n    // - https://github.com/webpack-contrib/file-loader\n    // - https://github.com/webpack-contrib/url-loader\n    src: 'path/to/logo.png',\n\n    // Output emitted by: https://github.com/image-size/image-size\n    width: 400,\n    height: 200,\n    bytes: 12345,\n    type: 'png',\n\n    // useful for console.log\n    toString: function() { /* ... */ }\n}\n```\n\n## Options (webpack)\n\nBy default, `useFileLoader` is `false`.\n\nIf `useFileLoader` is `false`, then `url-loader` is wrapped. Any given options will be passed onto this loader.\n\nHowever, if you pass `useFileLoader: true`, then [`file-loader`](https://github.com/webpack-contrib/file-loader) will be used, and any given options will be passed onto that loader.\n\n## Supported file-types\n\n[`image-size`](https://github.com/image-size/image-size) is used internally.\n\nSee: https://github.com/image-size/image-size#supported-formats\n\n## Use case\n\n```js\n// project_root/src/components/logo.js\n\nimport styled from \"styled-components\";\n\nimport logo_img from \"images/logos/homepage.png\";\nimport { bg_image } from \"styles/mixins\";\n\nconst Logo = styled.div`\n    display: inline-block;\n\n    ${bg_image(logo_img, /* resolution */ 2)};\n`;\n\nexport default Logo;\n```\n\n```js\n// project_root/src/styles/mixins.js\n\nimport { css } from \"styled-components\";\n\nexport const bg_image = (resolved_image, resolution) =\u003e {\n    const width = `${resolved_image.width / resolution}px`;\n    const height = `${resolved_image.height / resolution}px`;\n\n    return css`\n\n        background-image: url('${resolved_image.src}');\n        background-repeat: no-repeat;\n        background-position: center;\n        background-size: ${width} ${height};\n\n        height: ${height};\n        width: ${width};\n\n    `;\n};\n```\n\nCredits\n=======\n\nCode is based on: https://github.com/boopathi/image-size-loader but wraps url-loader and file-loader.\n\nDevelopment\n===========\n\n- `node.js` and `npm`. See: https://github.com/creationix/nvm#installation\n- `yarn`. See: https://yarnpkg.com/en/docs/install\n- `npm` dependencies. Run: `yarn install`\n\n## Chores\n\n- Lint: `yarn run lint`\n- Prettier: `yarn run pretty`\n- Test: `yarn run test`\n- Pre-publish: `yarn run prepublish`\n- Build: `yarn run build`\n\nLicense\n=======\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdashed%2Fsizeof-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdashed%2Fsizeof-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdashed%2Fsizeof-loader/lists"}