{"id":22433723,"url":"https://github.com/gavinning/images-request-queue","last_synced_at":"2025-03-27T07:46:05.592Z","repository":{"id":57272333,"uuid":"90738273","full_name":"gavinning/images-request-queue","owner":"gavinning","description":"图片请求队列","archived":false,"fork":false,"pushed_at":"2017-05-10T05:57:48.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T12:46:37.834Z","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/gavinning.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":"2017-05-09T11:30:55.000Z","updated_at":"2017-05-09T11:37:44.000Z","dependencies_parsed_at":"2022-09-12T16:11:52.779Z","dependency_job_id":null,"html_url":"https://github.com/gavinning/images-request-queue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fimages-request-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fimages-request-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fimages-request-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fimages-request-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gavinning","download_url":"https://codeload.github.com/gavinning/images-request-queue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245806390,"owners_count":20675296,"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-12-05T22:15:44.401Z","updated_at":"2025-03-27T07:46:05.384Z","avatar_url":"https://github.com/gavinning.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Images-request-queue\n---\n图片处理队列\n\n```sh\nnpm i images-request-queue --save\n```\n\n### Usage\n```js\nconst IR = require('images-request-queue')\nconst ir = new IR([ imgurls ])\n\nir.load(2).then(res =\u003e console.log(res))\n```\n简单url列表的递归应用\n```js\nconst IR = require('images-request-queue')\nconst ir = new IR( easyList )\nfunction render() {\n    ir.load(2).then(res =\u003e {\n        if(!res.length) return\n        res.forEach((img, index) =\u003e {\n            document.body.appendChild(img)\n            if(index === res.length-1){\n                render()\n            }\n        })\n    })\n}\nrender()\n```\n深度url列表的递归应用\n```js\nconst IR = require('images-request-queue')\nconst ir = new IR({\n    deep: 'img.url',\n    list: deepList\n})\nfunction render() {\n    ir.load(2).then(res =\u003e {\n        if(!res.length) return\n        res.forEach((img, index) =\u003e {\n            document.body.appendChild(img)\n            if(index === res.length-1){\n                render()\n            }\n        })\n    })\n}\nrender()\n```\n\n简单url列表\n```js\nvar easyList = [\n    'http://a.com/1.jpg',\n    'http://a.com/2.jpg',\n    'http://a.com/3.jpg',\n    'http://a.com/4.jpg',\n    'http://a.com/5.jpg',\n]\n```\n\n深度url列表\n```js\nvar deepList = [\n    {\n        id: 1,\n        img: {\n            url: 'http://a.com/1.jpg'\n        }\n    },\n    {\n        id: 2,\n        img: {\n            url: 'http://a.com/2.jpg'\n        }\n    },\n    {\n        id: 3,\n        img: {\n            url: 'http://a.com/3.jpg'\n        }\n    },\n    {\n        id: 4,\n        img: {\n            url: 'http://a.com/4.jpg'\n        }\n    },\n    {\n        id: 5,\n        img: {\n            url: 'http://a.com/5.jpg'\n        }\n    },\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinning%2Fimages-request-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgavinning%2Fimages-request-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinning%2Fimages-request-queue/lists"}