{"id":13548296,"url":"https://github.com/Ewocker/vue-lodash","last_synced_at":"2025-04-02T21:31:14.740Z","repository":{"id":20160243,"uuid":"89040786","full_name":"Ewocker/vue-lodash","owner":"Ewocker","description":"This is a small wrapper for integrating lodash into VueJs","archived":false,"fork":false,"pushed_at":"2023-01-08T02:53:25.000Z","size":4848,"stargazers_count":105,"open_issues_count":32,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-14T21:46:30.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Ewocker.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":"2017-04-22T03:09:58.000Z","updated_at":"2023-05-09T04:01:09.000Z","dependencies_parsed_at":"2023-01-13T09:45:00.055Z","dependency_job_id":null,"html_url":"https://github.com/Ewocker/vue-lodash","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/Ewocker%2Fvue-lodash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ewocker%2Fvue-lodash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ewocker%2Fvue-lodash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ewocker%2Fvue-lodash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ewocker","download_url":"https://codeload.github.com/Ewocker/vue-lodash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246895717,"owners_count":20851320,"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-08-01T12:01:08.410Z","updated_at":"2025-04-02T21:31:14.467Z","avatar_url":"https://github.com/Ewocker.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","公用事业","Components \u0026 Libraries","Utilities","Utilities [🔝](#readme)"],"sub_categories":["杂","Utilities","Miscellaneous"],"readme":"# vue-lodash\n\n[![NPM](https://nodei.co/npm/vue-lodash.png?downloadRank=true)](https://nodei.co/npm/vue-lodash/)\n[![Known Vulnerabilities](https://snyk.io/test/github/ewocker/vue-lodash/badge.svg)](https://snyk.io/test/github/ewocker/vue-lodash)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/ewocker/vue-lodash/master/LICENSE)\n\n\u003e A small wrapper for integrating lodash to Vuejs\n(Inspired by [vue-axios](https://github.com/imcvampire/vue-axios) plugin)\n\n## Install\n\n```\nnpm install --save vue-lodash lodash\n```\n\n## Usage\n\n```javascript\nimport Vue from 'vue'\nimport VueLodash from 'vue-lodash'\nimport lodash from 'lodash'\n\n// name is optional\nVue.use(VueLodash, { name: 'custom' , lodash: lodash })\n\nnew Vue({\n  el: '#app',\n  methods: {\n    test() {\n      console.log(this.lodash.random(20))\n      console.log(this._.random(20))\n      console.log(this.custom.random(20))\n    },\n  }\n})\nconsole.log(Vue.lodash.random(20))\nconsole.log(Vue._.random(20))\nconsole.log(Vue.custom.random(20))\n```\n\n## Typescript\n\nUsing __custom name__ with typescript is currently unsupported without casting.\n\n```typescript\nimport Vue from 'vue'\nimport VueLodash from 'vue-lodash'\nimport lodash from 'lodash'\n\nVue.use(VueLodash, { name: 'custom', lodash: { map, random } })\n\nnew Vue({\n  el: '#app',\n  methods: {\n    testLodash() {\n      console.log(this.lodash.random(20))\n      console.log(this._.random(20))\n      console.log((this as any).custom.random(20))\n    },\n  }\n})\nconsole.log(Vue.lodash.random(20))\nconsole.log(Vue._.random(20))\nconsole.log((Vue as any).custom.random(20))\n```\n\n## Tree shaking with lodash\n\nOnly import the packages you need, note that lodash tree shaking has to do import with path to module.\n\n```typescript\nimport Vue from 'vue'\nimport VueLodash from 'vue-lodash'\nimport random from 'lodash/random'\nimport map from 'lodash/map'\n\nVue.use(VueLodash, { name: 'custom', lodash: { map, random } })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEwocker%2Fvue-lodash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEwocker%2Fvue-lodash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEwocker%2Fvue-lodash/lists"}