{"id":17233884,"url":"https://github.com/caseywebdev/dpr","last_synced_at":"2025-08-20T12:20:37.237Z","repository":{"id":4029755,"uuid":"5130176","full_name":"caseywebdev/dpr","owner":"caseywebdev","description":"Trying to make life easier in a world with too many device pixel ratios.","archived":false,"fork":false,"pushed_at":"2015-03-09T21:13:08.000Z","size":245,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-04T01:06:05.001Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caseywebdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-21T01:20:58.000Z","updated_at":"2015-03-09T21:13:09.000Z","dependencies_parsed_at":"2022-08-30T14:51:22.513Z","dependency_job_id":null,"html_url":"https://github.com/caseywebdev/dpr","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/caseywebdev/dpr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caseywebdev%2Fdpr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caseywebdev%2Fdpr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caseywebdev%2Fdpr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caseywebdev%2Fdpr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caseywebdev","download_url":"https://codeload.github.com/caseywebdev/dpr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caseywebdev%2Fdpr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265250531,"owners_count":23734726,"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-10-15T05:27:05.607Z","updated_at":"2025-07-14T06:06:57.473Z","avatar_url":"https://github.com/caseywebdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"dpr\n===\n\nTrying to make life easier in a world with too many **d**evice **p**ixel\n**r**atios.\n\nInstall\n-------\n\n```bash\n(bower|npm) install dpr\n```\n\nUse\n---\n\n```js\n// Return the current device pixel ratio. The reason this is not a constant is\n// it can change between monitors!\ndpr();\n\n// Update the config. The defaults are shown.\ndpr({\n\n  // These are the ratios we have images for. Sort ASC (i.e. [1, 1.5, 2])\n  supported: [1, 2, 3],\n\n  // Specify a fallback for when the DPR cannot be determined.\n  fallback: 2,\n\n  // What part of the file do we want to replace?\n  match: /(\\..*)/,\n\n  // How should filename alterations be formatted? (# is the dpr)\n  replace: '@#x$1',\n\n  // Should filenames with DPR of 1 be formatted?\n  formatOne: false\n});\n\n// Get a dpr-appropriate file name.\n// returns 'foo-bar.png' for dpr=1, 'foo-bar@2.png' for dpr=2, etc...\ndpr('foo-bar.png');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaseywebdev%2Fdpr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaseywebdev%2Fdpr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaseywebdev%2Fdpr/lists"}