{"id":16441951,"url":"https://github.com/pspgbhu/preloadimg","last_synced_at":"2025-07-25T09:04:28.166Z","repository":{"id":57329791,"uuid":"91114409","full_name":"pspgbhu/preloadimg","owner":"pspgbhu","description":"🌅 A library for preload images","archived":false,"fork":false,"pushed_at":"2017-06-10T03:13:56.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T16:46:24.527Z","etag":null,"topics":["preload","preload-image","preload-images","preloadimg"],"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/pspgbhu.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-05-12T17:26:10.000Z","updated_at":"2022-08-22T09:31:45.000Z","dependencies_parsed_at":"2022-09-10T13:51:27.452Z","dependency_job_id":null,"html_url":"https://github.com/pspgbhu/preloadimg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pspgbhu/preloadimg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pspgbhu%2Fpreloadimg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pspgbhu%2Fpreloadimg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pspgbhu%2Fpreloadimg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pspgbhu%2Fpreloadimg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pspgbhu","download_url":"https://codeload.github.com/pspgbhu/preloadimg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pspgbhu%2Fpreloadimg/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260268634,"owners_count":22983601,"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":["preload","preload-image","preload-images","preloadimg"],"created_at":"2024-10-11T09:15:54.411Z","updated_at":"2025-06-17T00:38:26.070Z","avatar_url":"https://github.com/pspgbhu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# preloadimg\n\n[![npm package](https://img.shields.io/npm/v/preloadimg.svg?style=flat-square)](https://www.npmjs.org/package/preloadimg)\n[![NPM downloads](http://img.shields.io/npm/dm/preloadimg.svg?style=flat-square)](https://npmjs.org/package/preloadimg)\n\nA library for preload images\n\n---\n\n## Install\n`npm install --save preloadimg`\n\n## Usage\nUse in script tag\n```html\n\u003cscript src=\"src/preloadimg.js\" charset=\"utf-8\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  var imgs = [\n    'img/image1.png',\n    'img/image2.png',\n    'img/image3.png',\n  ];\n\n  preloadimg(imgs, success =\u003e {  // everyone image preloaded success\n    console.log(success);\n\n  }, fail =\u003e {    // everyone image preloaded fail\n    console.log(fail)\n\n  }, () =\u003e {    // it will be called when all images preloaded whatever succeeded or failed\n    console.log('all images preload completely!')\n  });\n\u003c/script\u003e\n```\nUse in ES6 modules or CommonJS\n```js\n// in ES6 modules\nimport preloadimg from 'preloadimg';\n\n// in CommonJS\n// var preloadimg = require('preloadimg');\n\npreloadimg([\n  'img/image1.png',\n  'img/image2.png',\n  'img/image3.png',\n], success =\u003e {   // everyone image preloaded success\n  console.log(success);\n}, fail =\u003e {    // everyone image preloaded fail\n  console.log(fail)\n}, () =\u003e {    // it will be called when all images preloaded whatever succeeded or failed\n  console.log('all images preload completely!')\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpspgbhu%2Fpreloadimg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpspgbhu%2Fpreloadimg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpspgbhu%2Fpreloadimg/lists"}