Gathering detailed insights and metrics for vue-cookie
Gathering detailed insights and metrics for vue-cookie
Gathering detailed insights and metrics for vue-cookie
Gathering detailed insights and metrics for vue-cookie
npm install vue-cookie
Typescript
Module System
Node Version
NPM Version
Version 1.1.4 - Added Bower support #9 and browser support for Number.isInteger #8
Updated on Feb 18, 2017
Version 1.1.3 - BUGFIX: vue-webpack build issue #7
Updated on Nov 15, 2016
Version 1.1.2 - Moved dev devepencies to devDepenencies to avoid conflict on install
Updated on Nov 08, 2016
Version 1.1.1 - Fixed faulty version number in package.json
Updated on Nov 07, 2016
Version 1.1.0 - Cookie domain support
Updated on Nov 07, 2016
Version 1.0.1 - Support for calling from vuex actions
Updated on Oct 17, 2016
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
817 Stars
23 Commits
71 Forks
17 Watchers
1 Branches
3 Contributors
Updated on Jun 04, 2025
Latest Version
1.1.4
Package Id
vue-cookie@1.1.4
Size
202.84 kB
NPM Version
4.1.2
Node Version
7.6.0
Published on
Apr 05, 2017
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
A Vue.js plugin for manipulating cookies tested up to Vue v2.0.5
Install through npm
1npm install vue-cookie --save 2
Include in <body>
after loading Vue and it will automatically hook into Vue
1<script src="/node_modules/vue-cookie/build/vue-cookie.js'"></script> 2
Or do it the cool way and load it in your main.js/app.js
1// Require dependencies 2var Vue = require('vue'); 3var VueCookie = require('vue-cookie'); 4// Tell Vue to use the plugin 5Vue.use(VueCookie); 6
The plugin is available through this.$cookie
in components or Vue.cookie
Rather than implementing my own Cookie handling logic the plugin now wraps the awesome tiny-cookie package
1// From some method in one of your Vue components 2this.$cookie.set('test', 'Hello world!', 1); 3// This will set a cookie with the name 'test' and the value 'Hello world!' that expires in one day 4 5// To get the value of a cookie use 6this.$cookie.get('test'); 7 8// To delete a cookie use 9this.$cookie.delete('test'); 10
1 2// Setting the cookie Domain 3this.$cookie.set('test', 'Random value', {expires: 1, domain: 'localhost'}); 4 5// As this cookie is set with a domain then if you wish to delete it you have to provide the domain when calling delete 6this.$cookie.delete('test', {domain: 'localhost'}); 7 8// Customizing expires 9var date = new Date; 10date.setDate(date.getDate() + 21); 11 12this.$cookie.set('dateObject', 'A date object', { expires: date }); 13this.$cookie.set('dateString', 'A parsable date string', { expires: date.toGMTString() }); 14this.$cookie.set('integer', 'Seven days later', { expires: 7 }); 15this.$cookie.set('stringSuffixY', 'One year later', { expires: '1Y' }); 16this.$cookie.set('stringSuffixM', 'One month later', { expires: '1M' }); 17this.$cookie.set('stringSuffixD', 'One day later', { expires: '1D' }); 18this.$cookie.set('stringSuffixh', 'One hour later', { expires: '1h' }); 19this.$cookie.set('stringSuffixm', 'Ten minutes later', { expires: '10m' }); 20this.$cookie.set('stringSuffixs', 'Thirty seconds later', { expires: '30s' }); 21
Thanks for using the plugin, I am happy to accept feedback/pull requests, do not forget to star if you like it!
Happy Coding! :D
This packacge uses the ´´´testemframework and
jasmine``` assertion library
1# Run npm install to fetch dependencies 2npm install 3 4# Then you may run the tests from 5npm run test-dev 6
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/16 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
123 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
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