Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-cookie

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-cookie

A Vue.js plugin for manipulating cookies

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7K
decreased by-39.19%
Maintainers
1
Weekly downloads
 
Created
Source

A Vue.js plugin for manipulating cookies

Installation

Install through npm

npm install vue-cookie --save

Include in <body> after loading Vue and it will automatically hook into Vue

<script src="/node_modules/vue-cookie/src/vue-cookie.js'"></script>

Or do it the cool way and load it in your main.js/app.js

// Require dependencies
var Vue = require('vue');
var VueCookie = require('vue-cookie');
// Tell Vue to use the plugin
Vue.use(VueCookie);

Usage

The plugin is available through this.$cookie in components

Example
// From some method in one of your Vue components
this.$cookie.set('test', 'Hello world!', 1);
// This will set a cookie with the name 'test' and the value 'Hello world!' that expires in one day

// To get the value of a cookie use
this.$cookie.get('test');

// To delete a cookie use
this.$cookie.delete('test');

Thanks for using the plugin, I am happy to accept feedback/pull requests, don not forget to star if you like it!

Happy Coding! :D

FAQs

Package last updated on 29 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc