{"id":21216737,"url":"https://github.com/ulixee/vue-runner","last_synced_at":"2025-03-15T00:41:39.932Z","repository":{"id":41700566,"uuid":"244669885","full_name":"ulixee/vue-runner","owner":"ulixee","description":"Easily launch and run any *.vue file as a standalone app","archived":false,"fork":false,"pushed_at":"2022-12-12T03:36:02.000Z","size":4774,"stargazers_count":0,"open_issues_count":28,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T09:47:56.636Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vue-runner","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/ulixee.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":"2020-03-03T15:18:55.000Z","updated_at":"2020-04-20T18:42:17.000Z","dependencies_parsed_at":"2023-01-27T12:45:55.104Z","dependency_job_id":null,"html_url":"https://github.com/ulixee/vue-runner","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/ulixee%2Fvue-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulixee%2Fvue-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulixee%2Fvue-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulixee%2Fvue-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ulixee","download_url":"https://codeload.github.com/ulixee/vue-runner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243667965,"owners_count":20328036,"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-20T21:55:27.614Z","updated_at":"2025-03-15T00:41:39.917Z","avatar_url":"https://github.com/ulixee.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"VueRunner is a simple library for quickly prototyping single *.vue files [without requiring global addons](https://cli.vuejs.org/guide/prototyping.html#instant-prototyping).\n\nUse VueRunner to launch any *.vue file from any NodeJS script with one line of code:\n\n```javascript\nnew require('vue-runner')('./Example.vue');\n```\n\nVueRunner makes it easy to incorporate Vue UI pages into backend scripts and CLI programs.\n\nVueRunner includes support for typescript, pug, scss, and svg. With one additional method you can attach a backend ExpressJS server for quickly prototyping of API commands.\n\n# Installing\n\n```bash\nnpm install vue-runner\n# --- or ---\nyard add vue-runner\n```\n\n# Creating a Simple Frontend\nInitialize VueRunner from any js/ts file and reference your *.vue component as the first argument.\n\n*example.ts*:\n```typescript\nimport VueRunner from 'vue-runner';\n\nnew VueRunner('./Example.vue');\n  .isReady.then(() =\u003e console.log('READY!!'));\n```\n\n*Example.vue*:\n```\n\u003ctemplate\u003e\n  \u003ch1\u003eHello!!\u003c/h1\u003e\n\u003c/template\u003e\n```\n\nVueRunner supports all the capabilities of a normal vue template, which means it can load full-blown vue components that import and reference other components.\n\nComplex.vue:\n```\n\u003ctemplate\u003e\n  \u003ch1\u003eHello!!\u003c/h1\u003e\n  \u003cmy-counter/\u003e\n\u003c/template\u003e\n\n\u003cscript lang=\"ts\"\u003e\n  import MyCounter from './MyCounter.vue';\n\n  @Component({ components { MyCounter } })\n  export default class App extends Vue {}\n\u003c/script\u003e\n```\n\n# Adding a Simple Backend API\n\nIf your vue file needs a backend API, VueRunner's attachAPI method makes this easy:\n\nexample.ts:\n```\nimport VueRunner from 'vue-runner';\n\nnew VueRunner('./API.vue');\n  .attachAPI((apiServer) =\u003e {\n    apiServer.get('/name', (req, res) =\u003e {\n      res.send('Caleb');\n    });\n  });\n```\n\nThe `apiServer` object is a standard [ExpressJS](https://expressjs.com/) instance. \n\nYour routes run on the same port as the frontend UI but under the `/api` path. This removes the need for complex CORS configuration.\n\nUse our simple API helper library to access with from frontend Vue components.\n\nAPI.vue\n```\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003ch1 v-if='name'\u003eConfirming your identity...\u003c/h1\u003e\n    \u003ch1\u003eHello, {{name}}!\u003c/h1\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript lang=\"ts\"\u003e\n  import API from 'vue-runner/API';\n  \n  class Hello {\n    async mounted() {\n      this.name = await API.get('/name');\n    }\n  }\n\u003c/script\u003e\n```\n\n# Full Reference Documentation\n\nnew VueRunner(pathToVueFile: string, options?: Options) =\u003e instance\n\nOptions:\n- port - string\n- title - string\n\ninstance.isReady =\u003e Promise\n\ninstance.attachAPI((apiServer) =\u003e void)\n\ninstance.on((event) =\u003e void)\n\nEvents:\n- listening\n- ready\n- error\n\n# ToDo:\n\n- Write unit tests\n- Figure out how to expose vue/webpack configuration and plugins\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulixee%2Fvue-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulixee%2Fvue-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulixee%2Fvue-runner/lists"}