{"id":20148332,"url":"https://github.com/nwutils/nw-img-vue","last_synced_at":"2025-03-03T00:25:54.837Z","repository":{"id":70664874,"uuid":"209613709","full_name":"nwutils/nw-img-vue","owner":"nwutils","description":"Caches copies of online images locally and loads them first if available","archived":false,"fork":false,"pushed_at":"2022-10-13T13:06:12.000Z","size":16,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T23:02:46.726Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://nwutils.io","language":"Vue","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/nwutils.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-09-19T17:40:20.000Z","updated_at":"2024-01-01T06:06:23.000Z","dependencies_parsed_at":"2023-02-22T05:45:56.424Z","dependency_job_id":null,"html_url":"https://github.com/nwutils/nw-img-vue","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"121a18bcf22554ed999d70998f00883213469a94"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwutils%2Fnw-img-vue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwutils%2Fnw-img-vue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwutils%2Fnw-img-vue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwutils%2Fnw-img-vue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nwutils","download_url":"https://codeload.github.com/nwutils/nw-img-vue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241587787,"owners_count":19986628,"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-11-13T22:37:17.244Z","updated_at":"2025-03-03T00:25:54.829Z","avatar_url":"https://github.com/nwutils.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nw-img-vue\n\nCaches copies of online images locally and loads them first if available\n\n\nShould work fine in Vue 2 or Vue 3.\n\n\n* * *\n\n\n## Usage:\n\n1. `npm install --save-dev nw-img-vue`\n1. In `main.js` add this:\n    ```js\n    import NwImg from 'nw-img-vue';\n    Vue.use(NwImg);\n    ```\n1. In any `.vue` file add\n    ```html\n    \u003cNwImg src=\"https://example.com/image.jpg\" alt=\"Example Alt Text\" /\u003e\n    ```\n    * Or this, depending on your setup.\n        ```html\n        \u003cnw-img src=\"https://example.com/image.jpg\" alt=\"Example Alt Text\"\u003e\u003c/nw-img\u003e\n        ```\n\nYou can also just download the `NwImg.vue` file directly from GitHub and drop it in your project. It is completely self-contained and requires no dependencies.\n\n\n* * *\n\n\nWorks well with **NW.js Vue-CLI Example**:\n\n* https://github.com/nwutils/nw-vue-cli-example\n\n\n* * *\n\n\n## How this works:\n\n\n### In NW.js\n\n* Checks for a local cached copy in the OS's appliction data folder (`window.nw.App.dataPath + '\\nw-img-cache\\'`)\n* If no local version exists, downloads the image to cache\n* Always display image from cache (to prevent double-downloading)\n\n\n### In Browsers\n\n* If `window.nw` or `window.require` is not detected, it just passes the URL directly into an `img` tag. No caching is performed. Useful for codebases that are used for both Web and Desktop builds.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwutils%2Fnw-img-vue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnwutils%2Fnw-img-vue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwutils%2Fnw-img-vue/lists"}