{"id":17471682,"url":"https://github.com/bezoerb/postcss-image-inliner","last_synced_at":"2025-04-09T15:09:25.031Z","repository":{"id":1379798,"uuid":"42685666","full_name":"bezoerb/postcss-image-inliner","owner":"bezoerb","description":"Image inliner for postcss","archived":false,"fork":false,"pushed_at":"2025-02-18T16:50:52.000Z","size":1743,"stargazers_count":16,"open_issues_count":4,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T15:09:20.054Z","etag":null,"topics":["inline-images","postcss"],"latest_commit_sha":null,"homepage":null,"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/bezoerb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-17T22:37:05.000Z","updated_at":"2024-10-06T21:49:52.000Z","dependencies_parsed_at":"2023-02-18T18:01:26.166Z","dependency_job_id":"b407adf3-e284-4209-9444-4824e4af6963","html_url":"https://github.com/bezoerb/postcss-image-inliner","commit_stats":{"total_commits":222,"total_committers":7,"mean_commits":"31.714285714285715","dds":0.5495495495495495,"last_synced_commit":"1d14b4c59440fbcf3575461da507ec893296580a"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezoerb%2Fpostcss-image-inliner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezoerb%2Fpostcss-image-inliner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezoerb%2Fpostcss-image-inliner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezoerb%2Fpostcss-image-inliner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bezoerb","download_url":"https://codeload.github.com/bezoerb/postcss-image-inliner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055282,"owners_count":21040157,"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":["inline-images","postcss"],"created_at":"2024-10-18T16:52:23.313Z","updated_at":"2025-04-09T15:09:25.010Z","avatar_url":"https://github.com/bezoerb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostCSS Image Inliner [![Build Status][ci-img]][ci]\n\n[PostCSS] plugin to inline local/remote images.\n\n[postcss]: https://github.com/postcss/postcss\n[ci-img]: https://github.com/bezoerb/postcss-image-inliner/workflows/Tests/badge.svg\n[ci]: https://github.com/bezoerb/postcss-image-inliner/actions?workflow=Tests\n\n```css\n.foo {\n  /* Input example */\n  background-image: url('https://placehold.it/10x10');\n}\n```\n\n```css\n.foo {\n  /* Output example */\n  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAo ... ORK5CYII=');\n}\n```\n\n## Installation\n\n```bash\nnpm i -D postcss postcss-image-inliner\n```\n\n## Usage\n\n```js\nconst postcss = require('postcss');\nconst imageInliner = require('postcss-image-inliner');\nconst opts = {\n  assetPaths: [], // List of directories where the inliner should look for assets\n  maxFileSize: 10240, // Sets a max file size (in bytes)\n};\n\npostcss([imageInliner(opts)]);\n```\n\nSee [PostCSS] docs for examples for your environment.\n\n## Options\n\n#### assetPaths\n\n- Type: `array`\n- Default: `[process.cwd()]`\n- Example: `['http://domain.de/', 'http://domain.de/styles', 'app/images', '**/images/']`\n- Required: `false`\n\nList of directories/URLs where the inliner should start looking for assets.\nYou can define local directories (globs supported) or URLs.\n\n#### maxFileSize\n\n- Type: `int`\n- Default: `10240`\n- Example: `0`\n- Required: `false`\n\nSets a max file size (in bytes) for inlined images. Set to `0` to disable size checking.\n\n#### largeFileCallback\n\n- Type: `function`\n- Default: undefined\n- Example: `function (file) { console.log('big file found:', file.path); return file.path }`\n- Required: `false`\n\nAllows you to act on large files and change the url if you'd like. Make sure you have `strict` set to `false` when using this.\n\n#### b64Svg\n\n- Type: `bool`\n- Default: `false`\n- Required: `false`\n\nUse Base64 encoding for SVGs.\n\n#### svgoPlugins\n\n- Type: `array`\n- Default: `[]`\n- Required: `false`\n\nUse custom svgo configuration for svg optimization\n\n#### strict\n\n- Type: `bool`\n- Default: `false`\n- Required: `false`\n\nFail on error.\n\n#### filter\n\n* Type: `regex`\n* Default: `/^(background(?:-image)?)|(content)|(cursor)/`\n* Required: `false`\n\nRegex to match the CSS properties to be inlined.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbezoerb%2Fpostcss-image-inliner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbezoerb%2Fpostcss-image-inliner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbezoerb%2Fpostcss-image-inliner/lists"}