{"id":15022917,"url":"https://github.com/sukima/ember-quine","last_synced_at":"2025-10-19T13:13:44.542Z","repository":{"id":35206907,"uuid":"215459068","full_name":"sukima/ember-quine","owner":"sukima","description":"Ember addon to build apps as self contained HTML files","archived":false,"fork":false,"pushed_at":"2022-12-11T09:35:41.000Z","size":1686,"stargazers_count":5,"open_issues_count":29,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-21T09:30:41.788Z","etag":null,"topics":["ember","ember-addon","ember-cli","emberjs","javascript"],"latest_commit_sha":null,"homepage":"https://sukima.github.io/ember-quine/","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/sukima.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-16T04:47:26.000Z","updated_at":"2023-02-04T21:14:31.000Z","dependencies_parsed_at":"2023-01-15T16:15:49.578Z","dependency_job_id":null,"html_url":"https://github.com/sukima/ember-quine","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukima%2Fember-quine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukima%2Fember-quine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukima%2Fember-quine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukima%2Fember-quine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sukima","download_url":"https://codeload.github.com/sukima/ember-quine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241852158,"owners_count":20030969,"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":["ember","ember-addon","ember-cli","emberjs","javascript"],"created_at":"2024-09-24T19:58:31.703Z","updated_at":"2025-10-19T13:13:39.495Z","avatar_url":"https://github.com/sukima.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ember-quine\n==============================================================================\n\n\u003e A quine is a computer program which takes no input and produces a copy of its\n\u003e own source code as its only output.\n\u003e ~ [Quine (computing) - Wikipedia](https://en.wikipedia.org/wiki/Quine_(computing))\n\nEmber Quine is an Ember addon that enables an Ember app to be self downloaded\nas a single HTML file that runs offline (via the `file://` URI).\n\nThis is best understood through demonstration. Vist the\n[live example](https://sukima.github.io/ember-quine/) and play with it.\n\n\nCompatibility\n------------------------------------------------------------------------------\n\n* Ember.js v3.4 or above\n* Ember CLI v2.13 or above\n* Node.js v8 or above\n\n\nInstallation\n------------------------------------------------------------------------------\n\n```\nember install ember-quine\n```\n\nBy default all JS and CSS assets are compiled into the final `index.html` file.\nTo disabled this (for development purposes) add the following to your\n`config/environment.js`:\n\n```js\nENV['ember-quine'] = { enabled: false };\n```\n\nUsage\n------------------------------------------------------------------------------\n\nThis addon provides a quine service which exposes methods to download the app\nand load/save/remove data from the document storage mechanism.\n\n### Downloading the Quine App\n\nUse the `download()` method to have the browser download a copy of the current\nrunning quine.\n\n```js\nimport Component from '@ember/component';\nimport { inject as service } from '@ember/service';\n\nexport default Component.extend({\n  quine: service(),\n\n  actions: {\n    download(filename) {\n      this.quine.download(filename);\n    }\n  }\n});\n```\n\nThis works by reading the HTML nodes (head and body) and capturing their\ninnerHTML. It then constructs a new HTML document with string concatenation. It\nthen builds a new \u003ca\u003e tag with its href set to the constructed HTML. It adds\nthe tag to the document, triggers a click action, and then removes the element.\n\n#### quine.download(filename)\n\nInitiates a download of the quine. It will reset `quine.isDirty` to false.\n\n**Triggered Events**\n\n* didDownload\n\n**Params**\n\n* filename `string|undefined` - the filename to save as. Will default to the\n  application name. It will add an `.html` extension if missing.\n\n### Data Storage\n\nThe data storage provided saves data to the DOM directly. See Data Store\nsection for more information.\n\n#### quine.loadStore(storeName)\n\nLoads the data from the DOM and returns the value stored.\n\n**Returns**: `any` - The payload stored in the data store or undefined if not\nfound\n\n**Params**\n\n* storeName string - The name of the store to load\n\n#### quine.saveStore(storeName, data)\n\nSaves data to the DOM. Will set `quine.isDirty` to true.\n\n**Triggered Events**\n\n* didSaveStore - passes an object with a storeName property\n* didChange\n\n**Params**\n\n* storeName `string` - The name of the store to save\n* data `any` - The payload to be saved to the data store\n\n#### quine.destroyStore(storeName)\n\nRemoves a stored set of data by storeName from the DOM. Will set\n`quine.isDirty` to true.\n\n**Triggered Events**\n\n* didDestroyStore - passes an object with a storeName property\n* didChange\n\n**Params**\n\n* storeName `string` - The name of the store to destroy\n\n#### quine.destroyAllStores()\n\nRemoves all data from the DOM. quine.isDirty to true.\n\n**Triggered Events**\n\n* didDestroyAllStores\n* didChange\n\n\nContributing\n------------------------------------------------------------------------------\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n\nLicense\n------------------------------------------------------------------------------\n\nThis project is licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukima%2Fember-quine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsukima%2Fember-quine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukima%2Fember-quine/lists"}