{"id":15498211,"url":"https://github.com/yuezk/postcss-urlrev","last_synced_at":"2025-04-22T22:16:29.761Z","repository":{"id":36793016,"uuid":"41099811","full_name":"yuezk/postcss-urlrev","owner":"yuezk","description":"PostCSS plugin for css url revision","archived":false,"fork":false,"pushed_at":"2022-03-19T13:23:56.000Z","size":122,"stargazers_count":20,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T02:26:26.719Z","etag":null,"topics":["css-url-revision","postcss","postcss-url"],"latest_commit_sha":null,"homepage":"https://npmjs.com/postcss-urlrev","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/yuezk.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}},"created_at":"2015-08-20T14:19:08.000Z","updated_at":"2023-11-15T11:45:29.000Z","dependencies_parsed_at":"2022-09-12T09:50:19.184Z","dependency_job_id":null,"html_url":"https://github.com/yuezk/postcss-urlrev","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuezk%2Fpostcss-urlrev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuezk%2Fpostcss-urlrev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuezk%2Fpostcss-urlrev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuezk%2Fpostcss-urlrev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuezk","download_url":"https://codeload.github.com/yuezk/postcss-urlrev/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249250810,"owners_count":21237961,"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":["css-url-revision","postcss","postcss-url"],"created_at":"2024-10-02T08:42:28.356Z","updated_at":"2025-04-17T01:31:48.665Z","avatar_url":"https://github.com/yuezk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postcss-urlrev\n\n\u003e [PostCSS] plugin for css url revision, inspired by [postcss-url]\n\n[![Build Status][ci-img]][ci]\n[![Coverage Status][co-img]][co]\n\n\n```css\n/* Input example */\n.foo {\n    background: url(images/test.png) 0 0 no-repeat;\n}\n```\n\n```css\n/* Output example */\n.foo {\n    background: url(images/test.png?v=e19ac7dee6) 0 0 no-repeat;\n}\n```\n\n## Install\n\nFor `postcss 8.x`\n\n```sh\nnpm install --save-dev postcss-urlrev\n```\n\nand for `postcss 6.x`\n\n```sh\nnpm install --save-dev postcss-urlrev@2.x\n```\n\n## Usage\n\n```js\nvar urlrev = require('postcss-urlrev');\npostcss(urlrev({ /* options */ }))\n```\n\n## Options\n\n### relativePath\n\nType: `string`  \nDefault: `the css file's folder`\n\nThe `relativePath` is used to calculate the absolute path of the url resource. \nBy default, the value is the folder path of the css source file. You should\nset this value based on your environment.\n\n### absolutePath\n\nType: `string`  \nDefault: `undefined`\n\nThe `absolutePath` is used to calculate the absolute path of the url resources that have an absolute path, f.ex. `/images/test.png`. \nIf `absolutePath` is not set, absolute url's will be skipped, as the full path to the resource cannot be resolved.\n\n### includeRemote\n\nType: `boolean`  \nDefault: `false`\n\nIf you set it to `true`, it will handle the remote url, request the remote \nresource and calculate the md5 hash.\n\n### hashFunction(filename, baseName)\n\nType: `function`  \nDefault: `undefined`\n\nIf specified, it will use the `hashFunction` to generate hash strings.\n\nThe function accepts two parameters:\n - `filename`: the absolute file path. (e.g. `/path/to/test.png`)\n - `baseName`: the base name of the file. (e.g. `test.png`)\n\n### replacer(url, hash)\n\nType: `function`  \nDefault: `defaultReplacer(url, hash)`\n\nIt will receive the `url` and `hash` as its parameter, you can specify a \nfunction to handle the url manually.\n\nA `replacer` example:\n\n```js\nfunction replacer(url, hash) {\n    return url + '?' + hash;\n}\n```\n\n\n### hashLength\n\nType: `number`  \nDefault: `10`\n\nThe length of the hash string, the default value is `10`. That's enough!\n\n\n## [Changelog](CHANGELOG.md)\n\n## License\n\n[MIT]\n\n[PostCSS]:      https://github.com/postcss/postcss\n[co-img]:       https://coveralls.io/repos/github/yuezk/postcss-urlrev/badge.svg?branch=master\n[co]:           https://coveralls.io/github/yuezk/postcss-urlrev?branch=master\n[ci-img]:       https://travis-ci.org/yuezk/postcss-urlrev.svg\n[ci]:           https://travis-ci.org/yuezk/postcss-urlrev\n[postcss-url]:  https://github.com/postcss/postcss-url\n[MIT]:          LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuezk%2Fpostcss-urlrev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuezk%2Fpostcss-urlrev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuezk%2Fpostcss-urlrev/lists"}