Socket
Socket
Sign inDemoInstall

js-cookies

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    js-cookies

[![NPM Version][npm-image]][npm-url]


Version published
Weekly downloads
3.6K
decreased by-13.7%
Maintainers
1
Install size
9.64 kB
Created
Weekly downloads
 

Readme

Source

cookies

[![NPM Version][npm-image]][npm-url]

how

npm install js-cookies

如果需要编译之后的版本

npm run build

封装document.cookie的一些简单操作,提供类似localstorage的API供调用。

import cookies from 'cookies';

cookies.setItem('foo', 'bar');
cookies.getItem('foo');
// bar
cookies.hasItem('foo');
// true
cookies.keys()
// ['foo']
cookie.removeItem('foo');
// ''

##test npm run devtest 在浏览器地址栏输入: http://localhost:8088/webpack-dev-server/test/index.html

License

MIT [npm-image]: https://img.shields.io/npm/v/cookie.svg [npm-url]: https://npmjs.org/package/cookie

Keywords

FAQs

Last updated on 06 Apr 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc