Gathering detailed insights and metrics for vue-ya-stash
Gathering detailed insights and metrics for vue-ya-stash
Gathering detailed insights and metrics for vue-ya-stash
Gathering detailed insights and metrics for vue-ya-stash
npm install vue-ya-stash
Typescript
Module System
Node Version
NPM Version
JavaScript (94.54%)
Shell (5.46%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
17 Stars
38 Commits
2 Forks
3 Watchers
2 Branches
1 Contributors
Updated on Jul 05, 2025
Latest Version
0.0.5
Package Id
vue-ya-stash@0.0.5
Size
4.91 kB
NPM Version
5.1.0
Node Version
8.1.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
23
Yet Another simple stash storage for Vue
1npm install vue-ya-stash
1export default { 2 stash: ['user', 'ui'], 3 mounted () { 4 console.log('this.user.name') 5 this.$emit('update:user', {...this.user, name: 'Bob'}) 6 this.$emit('patch:ui', 'sidebar.visible', true ) 7 } 8}
props
-emit
)#3 is being specially concerned.
As you see from example, one can effortlessly switch between props-emit
and stash
model.
Furthermore ways of universal components for two models will be supported. I wish :)
1npm install --save vue-ya-stash
1import Vue from 'vue' 2import stashStore from './stash' 3 4new Vue({ 5 el: '#app', 6 router, 7 stashStore, 8 template: '<App/>', 9 components: { App } 10})
./stash/index.js
1import Vue from 'vue' 2import VueYaStash from 'vue-ya-stash' 3 4Vue.use(VueYaStash) 5 6var stash = { 7 user: { 8 name: 'Ted', 9 email: 'ted@example.com' 10 }, 11 ui: { 12 sidebar: { 13 visible: true 14 } 15 } 16} 17 18var stashContainer = new Vue({ 19 data: { 20 stash: stash 21 } 22}) 23 24export default stashContainer.stash
1Vue.component('user-card', { 2 stash: ['user', 'ui'], 3 created () { 4 // Access 5 console.log(this.user.name) 6 // Update 7 this.$emit('update:user', {...this.user, name: 'Bob'}) 8 // Patch 9 this.$emit('patch:user', 'name', 'Bob') 10 } 11});
1Vue.component('user-card', { 2 stash: { 3 name: 'user.name', 4 sidebar: 'ui.sidebar' 5 } 6 created () { 7 // Access 8 console.log(this.name) 9 console.log(this.sidebar.visible) 10 // Update 11 this.$emit('update:name', 'Bob') 12 this.$emit('update:sidebar', {...this.sidebar, visible: true}) 13 // Patch 14 this.$emit('patch:sidebar', 'visible', true) 15 } 16});
To update parts of stash, one can use patch
instead of update
1this.$emit('patch:key', path_string, update_value)
For example after you mounted stash.ui
from above, you can change stash.ui.sidebar.visible
with patch
1Vue.component('nav-bar', { 2 stash: ['ui'] 3 methods: { 4 toggleSidebar () { 5 this.$emit('patch:ui', 'sidebar.visible', !ui.sidebar.visible) 6 } 7 } 8}
A path string can cover dot(.
) references and also square brackets('[]').
1this.$emit('patch:ui', 'sidebar.menu[4].content', 'new value')
Path strings should be same as what one does with real javascript syntex.
You can't do
1this.$emit('patch:menu', 1, 'new value')
But you should do
1this.$eimt(`patch:menu', '[1]', 'new value')
Path string is strictly parsed and will throw errors in advance.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
66 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More