{"id":13520433,"url":"https://github.com/TotomInc/loaderz","last_synced_at":"2025-03-31T16:31:26.901Z","repository":{"id":48014128,"uuid":"121038109","full_name":"TotomInc/loaderz","owner":"TotomInc","description":":zap: A very easy-to-use, blazing fast asset-loader using promises. Support older-browsers and preload images, audios and videos.","archived":true,"fork":false,"pushed_at":"2021-08-11T01:21:24.000Z","size":2616,"stargazers_count":127,"open_issues_count":6,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-02T05:23:37.145Z","etag":null,"topics":["assetloader","es6","game-utility","preloader","promise","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/TotomInc.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":"2018-02-10T17:40:32.000Z","updated_at":"2023-10-22T14:39:12.000Z","dependencies_parsed_at":"2022-08-12T16:40:44.448Z","dependency_job_id":null,"html_url":"https://github.com/TotomInc/loaderz","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/TotomInc%2Floaderz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotomInc%2Floaderz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotomInc%2Floaderz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotomInc%2Floaderz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TotomInc","download_url":"https://codeload.github.com/TotomInc/loaderz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222670691,"owners_count":17020513,"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":["assetloader","es6","game-utility","preloader","promise","typescript"],"created_at":"2024-08-01T05:02:20.530Z","updated_at":"2024-11-02T03:31:32.358Z","avatar_url":"https://github.com/TotomInc.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://i.imgur.com/dVPbYeS.png\" height=\"150px\" width=\"auto\"\u003e\n\u003c/p\u003e\n\n[![Build Status](https://travis-ci.org/TotomInc/loaderz.svg?branch=master)](https://travis-ci.org/TotomInc/loaderz) [![license](https://img.shields.io/david/dev/totominc/loaderz.svg)]() [![license](https://img.shields.io/npm/v/loaderz.svg)]() [![license](https://img.shields.io/github/license/mashape/apistatus.svg)]()\n\n\u003e A very easy-to-use asset-loader using promises. Supports images, audio and video. Fully documented for a perfect usage in your TypeScript projects.\n\n## Installation\n\nInstall using `yarn` or `npm`:\n\n- `yarn add loaderz`\n- `npm install loaderz --save`\n\n## Usage\n\n```typescript\n// Default export of Loaderz is the Loader.\nimport Loader from 'loaderz';\n\n// A list of heavy images to load, it could be art-assets for your HTML5 game\nconst images = [\n  'https://images.unsplash.com/photo-1549360336-6a77ea5193eb',\n  'https://images.unsplash.com/photo-1549379458-e8f7034360a9',\n  'https://images.unsplash.com/photo-1548175850-b5a765959436',\n];\n\n// Some audio elements to spice-up your HTML5 game\nconst audios = [\n  'http://www.sample-videos.com/audio/mp3/crowd-cheering.mp3',\n  'http://www.sample-videos.com/audio/mp3/wave.mp3',\n];\n\n// Instanciate the loader, you can easily implement it anywhere in your project\nconst loader = new Loader();\n\n// Queue all our different resources (we can chain since queue returns the\n// instance of loader)\nloader\n  .queue('image', images)\n  .queue('audio', audios);\n\n// Start loading the resources and have a full control of the global loading\n// state using a promise and return a response with all elements loaded\nloader.start()\n  .then(response =\u003e console.log('All urls have been loaded, do whatever you want here:', response));\n```\n\n## Docs\n\n- `Loader#queue(type: string, src: string | string[])`: accepts 3 different types of medias (audio, image, video).\n- `Loader#start()`: used to load all the queued resources. Returns a global promise of the resources loading.\n\n- `Loader#queuedImages`: an array of URLs of images queued to load.\n- `Loader#queuedMedias`: an array of `MediaData` elements queued to load.\n\n## Contribute\n\nAll the code is written in TypeScript. Feel free to contribute by creating issues, PRs or suggesting new features:\n\n1. Fork and clone the repo: `git@github.com:username/loaderz.git`\n2. Install all dev-deps: `yarn install` or `npm install`\n3. Run the demo: `yarn demo` (`localhost:8080`)\n4. Edit some files\n5. Run tests: `yarn test` or `npm test`\n   - (optional) run `yarn lint` or `npm run lint` to automatically lint the files\n6. Commit and push your edits on a separate branch\n7. Create a PR which points on the `develop` branch\n\n## License\n\nUnder MIT license, view the license file for more informations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTotomInc%2Floaderz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTotomInc%2Floaderz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTotomInc%2Floaderz/lists"}