{"id":16860465,"url":"https://github.com/webpro/dyson-image","last_synced_at":"2025-10-10T23:11:13.506Z","repository":{"id":6919809,"uuid":"8170569","full_name":"webpro/dyson-image","owner":"webpro","description":null,"archived":false,"fork":false,"pushed_at":"2019-10-03T20:14:39.000Z","size":311,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-22T00:58:02.542Z","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/webpro.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":"2013-02-13T00:33:14.000Z","updated_at":"2023-09-08T16:37:42.000Z","dependencies_parsed_at":"2022-09-04T00:10:53.996Z","dependency_job_id":null,"html_url":"https://github.com/webpro/dyson-image","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/webpro/dyson-image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpro%2Fdyson-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpro%2Fdyson-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpro%2Fdyson-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpro%2Fdyson-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webpro","download_url":"https://codeload.github.com/webpro/dyson-image/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpro%2Fdyson-image/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005550,"owners_count":26083918,"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-10-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2024-10-13T14:24:24.638Z","updated_at":"2025-10-10T23:11:13.474Z","avatar_url":"https://github.com/webpro.png","language":"JavaScript","readme":"# dyson-image\n\nImage proxy and base64 string generator.\n\nRequests are proxied to [http://dummyimage.com](http://dummyimage.com) by default.\n\nUsed by [dyson-generators](http://github.com/webpro/dyson-generators) (for base64 image strings) and [dyson](http://github.com/webpro/dyson) (as middleware).\n\n## Installation\n\nInstall dyson-image locally by including it in `package.json` as a `devDependency`:\n\n    \"devDependencies\": {\n        \"dyson-image\": \"~0.1\"\n    }\n\n## Examples\n\n### Image buffer\n\nThe `image.request()` method returns a promise which gets resolved with an object containing `mimeType` and `buffer`.\n\nThe examples below both create a base64 string representation of a 300x200 image:\n\n    var image = require('dyson-image');\n\n    image.request({\n        host: 'http://dummyimage.com',\n        path: '/300x200'\n    }).then(function(imageObj) {\n        var imgBase64 = imageObj.buffer.toString('base64');\n        console.log('data:' + imageObj.mimeType + ';base64,' + imgBase64);\n    });\n\n    image.request({\n        width: 300,\n        height: 200\n    }).then(function(imageObj) {\n        //\n    });\n\n### Middleware for Express\n\n    var image = require('dyson-image');\n\n    app.get('/image/*', image.asMiddleware);\n\nA request to `/image/300x200` will be proxied to `http://dummyimage.com/300x200`, and served as image.\n\n## Development \u0026 run tests\n\n    git clone git@github.com:webpro/dyson-image.git\n    cd dyson-image\n    npm install\n    npm test\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpro%2Fdyson-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebpro%2Fdyson-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpro%2Fdyson-image/lists"}