You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

js-cookies

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

js-cookies

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

1.0.4
latest
beta-1.0.4
Source
npmnpm
Version published
Weekly downloads
6.8K
10.75%
Maintainers
1
Weekly downloads
 
Created
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

cookie

FAQs

Package last updated on 06 Apr 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.