{"id":14971182,"url":"https://github.com/dotneet/nuxtend","last_synced_at":"2025-08-10T07:15:42.436Z","repository":{"id":25700786,"uuid":"104974689","full_name":"dotneet/nuxtend","owner":"dotneet","description":"This library extends the Nuxt.js features.","archived":false,"fork":false,"pushed_at":"2022-12-03T13:44:33.000Z","size":500,"stargazers_count":27,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-31T02:45:49.411Z","etag":null,"topics":["javascript","nuxtjs","vuejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotneet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-27T05:13:16.000Z","updated_at":"2025-03-08T14:58:38.000Z","dependencies_parsed_at":"2023-01-14T03:12:16.682Z","dependency_job_id":null,"html_url":"https://github.com/dotneet/nuxtend","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/dotneet/nuxtend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotneet%2Fnuxtend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotneet%2Fnuxtend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotneet%2Fnuxtend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotneet%2Fnuxtend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotneet","download_url":"https://codeload.github.com/dotneet/nuxtend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotneet%2Fnuxtend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269690619,"owners_count":24459874,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","nuxtjs","vuejs"],"created_at":"2024-09-24T13:44:49.480Z","updated_at":"2025-08-10T07:15:42.388Z","avatar_url":"https://github.com/dotneet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This library makes Nuxt.js possible to use mixin for asyncData()/fetch() and provide some helpful features.\n\n## Install\n\n```bash\nnpm i nuxtend\n```\n\n## Mixin\n\n```js\nimport nuxtend from 'nuxtend'\n\nconst m = {\n  async asyncData (context) {\n    // works!\n    return {commonData: 'data'}\n  }\n}\n\nexport default nuxtend({\n  mixins: [m],\n  async asyncData (context) {\n    return {}\n  }\n})\n```\n\n## methods can be used on asyncData/fetch via `this`.\n\nThis feature enables you to call a vuex action in same syntax anywhere. \nOf course you can call non vuex action methods also.\n\n```js\nimport nuxtend from 'nuxtend'\nimport {mapActions} from 'vuex'\n\nconst mixinA = {\n  methods: {\n    ...mapActions({'findBooks': 'books/find'})\n  }\n}\n\nexport default nuxtend({\n  mixins: [mixinA],\n  async asyncData (context) {\n    const books = await this.findBooks()\n    const audios = await this.findAudios()\n    return {\n      books,\n      audios\n    }\n  },\n  mounted () {\n    this.findBooks()\n  },\n  methods: {\n    ...mapActions({\n      'findAudios': 'audios/find'\n    })\n  }\n})\n```\n\n## Abstraction of calling api and actions. (since 0.2.0)\n\n```js\nexport default nuxnted({\n  nuxtend: {\n    actions: ['apple', 'me/banana']\n  },\n  async asyncData () {\n    // if 'apples/get' action is defined call it, if not call $axios.get('/apples/10')\n    const res = await this.getApple(10)\n    // and also below functions can be used as well.\n    // - action: 'apples/getList'  api: this.$axios.get('/apples', {params: {status: 'dropped'}})\n    // this.getAppleList({status: 'dropped'})\n    // - action: 'apples/create'  api: this.$axios.post('/apples', {status: 'dropped'})\n    // this.postApple({status: 'dropped'})\n    // - action: 'apples/update'  api: this.$axios.put('/apples/10', {status: 'dropped'})\n    // this.putApple({id: 10, params: {status: 'dropped'}})\n    // - action: 'apples/delete'  api: this.$axios.delete('/apples/10')\n    // this.deleteApple(10)\n\n    // - action: 'me/bananas/get' api: this.$axios.get('/me/bananas/10')\n    // this.getBanaa(1)\n\n    return {\n      apple: res.data\n    }\n  }\n})\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotneet%2Fnuxtend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotneet%2Fnuxtend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotneet%2Fnuxtend/lists"}