{"id":29602004,"url":"https://github.com/neilveil/deload","last_synced_at":"2025-07-20T13:37:24.148Z","repository":{"id":203529525,"uuid":"696639078","full_name":"neilveil/deload","owner":"neilveil","description":"Dynamically load scripts \u0026 stylesheets when required","archived":false,"fork":false,"pushed_at":"2024-06-26T03:23:20.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T14:14:15.891Z","etag":null,"topics":["dynamic-loading","lightweight-build","load-time-optimization","performance-enhancement","web-performance"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/deload","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/neilveil.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-26T06:40:18.000Z","updated_at":"2024-08-07T12:08:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"73796163-5ff7-4919-b21a-7a3a7fb42816","html_url":"https://github.com/neilveil/deload","commit_stats":null,"previous_names":["neilveil/deload"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/neilveil/deload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neilveil%2Fdeload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neilveil%2Fdeload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neilveil%2Fdeload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neilveil%2Fdeload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neilveil","download_url":"https://codeload.github.com/neilveil/deload/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neilveil%2Fdeload/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266135049,"owners_count":23881775,"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":["dynamic-loading","lightweight-build","load-time-optimization","performance-enhancement","web-performance"],"created_at":"2025-07-20T13:37:12.349Z","updated_at":"2025-07-20T13:37:24.143Z","avatar_url":"https://github.com/neilveil.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deload\r\n\r\n[![Downloads](https://img.shields.io/npm/dm/deload.svg)](https://www.npmjs.com/package/deload) [![Version](https://img.shields.io/npm/v/deload.svg)](https://www.npmjs.com/package/deload)\r\n\r\n**✨ Load scripts and stylesheets precisely when needed, optimizing performance and efficiency. ✨**\r\n\r\n**🍃 Developed with 0 external dependencies in less than 1KB**\r\n\r\n## Why?\r\n\r\n- **🚀 Better load time:** Deload ensures that scripts and stylesheets are loaded only when required, reducing initial load times and enhancing the user experience.\r\n- **📦 Small build size:** By dynamically loading resources, Deload keeps your application's build size lean, preventing unnecessary bloat and optimizing resource usage.\r\n- **🎯 Event-based system:** Get complete control over resource loading events, ensuring seamless integration and flexibility in your projects.\r\n\r\n## Usage examples\r\n\r\n```js\r\nimport { deloadJS, deloadCSS } from 'deload'\r\n\r\n// Load script/stylesheet\r\nawait deloadJS('https://www.myapp.com/script.js')\r\nawait deloadCSS('https://www.myapp.com/styles.css')\r\n\r\n// or\r\ndeloadJS('https://www.myapp.com/script.js')\r\n  .then(() =\u003e {\r\n    console.log('Loaded!')\r\n  })\r\n  .catch(error =\u003e {\r\n    console.log('Error while loading script!')\r\n  })\r\n\r\n// Load multiple scripts\r\nawait deloadJS(['https://www.myapp.com/script1.js', 'https://www.myapp.com/script2.js'])\r\n\r\n// Set attributes\r\nawait deloadJS(\r\n  [\r\n    'https://www.myapp.com/script1.js',\r\n    'https://www.myapp.com/script2.js'\r\n  ],\r\n  {\r\n    crossorigin: '',\r\n    'data-example-att': 'hello'\r\n  }\r\n)\r\n```\r\n\r\nNote: 👍 Deload does not reload a script/stylesheet if it has already been loaded once, ensuring optimal resource management.\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Feel free to open an issue or submit a pull request.\r\n\r\n## License\r\n\r\nThis project is licensed under the [MIT License](./license.txt).\r\n\r\n## Developer\r\n\r\nDeveloped \u0026 maintained by [neilveil](https://github.com/neilveil).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneilveil%2Fdeload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneilveil%2Fdeload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneilveil%2Fdeload/lists"}