@analytics/cookie-utils
Advanced tools
Comparing version
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.2.4](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-cookie/compare/@analytics/cookie-utils@0.2.3...@analytics/cookie-utils@0.2.4) (2021-07-20) | ||
**Note:** Version bump only for package @analytics/cookie-utils | ||
## [0.2.3](https://github.com/DavidWells/analytics/compare/@analytics/cookie-utils@0.2.2...@analytics/cookie-utils@0.2.3) (2020-04-16) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@analytics/cookie-utils", | ||
"version": "0.2.3", | ||
"description": "Cookie helper functions", | ||
"version": "0.2.4", | ||
"description": "Tiny cookie utility library", | ||
"author": "David Wells", | ||
"license": "MIT", | ||
"homepage": "https://github.com/DavidWells/analytics#readme", | ||
"homepage": "https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-cookie#readme", | ||
"repository": "https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-cookie", | ||
"keywords": [ | ||
@@ -14,17 +15,22 @@ "analytics", | ||
], | ||
"main": "lib/analytics-util-cookie.cjs.js", | ||
"globalName": "analyticsUtilCookie", | ||
"jsnext:main": "lib/analytics-util-cookie.es.js", | ||
"module": "lib/analytics-util-cookie.es.js", | ||
"browser": { | ||
"./lib/analytics-util-cookie.cjs.js": "./lib/analytics-util-cookie.browser.cjs.js", | ||
"./lib/analytics-util-cookie.es.js": "./lib/analytics-util-cookie.browser.es.js" | ||
}, | ||
"netlifySiteId": "8e3043e9-1557-4849-b4cc-ead830d41e01", | ||
"amdName": "utilCookies", | ||
"source": "src/index.js", | ||
"main": "dist/analytics-util-cookie.js", | ||
"module": "dist/analytics-util-cookie.module.js", | ||
"unpkg": "dist/analytics-util-cookie.umd.js", | ||
"scripts": { | ||
"build": "node ../../scripts/build/index.js", | ||
"watch": "node ../../scripts/build/_watch.js", | ||
"start": "npm run sync && concurrently 'npm:watch:dev' 'npm:copy' 'npm:serve'", | ||
"serve": "servor dist index.html 8081 --reload --browse", | ||
"copy": "watchlist example -- npm run sync", | ||
"sync": "cp example/index.html dist", | ||
"watch": "microbundle watch", | ||
"watch:dev": "microbundle watch --external none --no-compress", | ||
"build": "microbundle", | ||
"build:dev": "microbundle build --external none", | ||
"release:patch": "npm version patch && npm publish", | ||
"release:minor": "npm version minor && npm publish", | ||
"release:major": "npm version major && npm publish", | ||
"es": "../../node_modules/.bin/babel-node ./testBabel.js" | ||
"deploy": "npm run build:dev && npm run sync && netlify deploy --prod --dir dist --site $npm_package_netlifySiteId", | ||
"postdeploy": "npm run build" | ||
}, | ||
@@ -38,11 +44,12 @@ "files": [ | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/DavidWells/analytics.git" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.4.5", | ||
"@babel/preset-env": "^7.4.5" | ||
"concurrently": "^6.1.0", | ||
"microbundle": "^0.13.0", | ||
"servor": "^4.0.2", | ||
"watchlist": "^0.2.3" | ||
}, | ||
"gitHead": "e0a23c74d7bb6848631b51413a6443025e8b0cef" | ||
"dependencies": { | ||
"@analytics/global-storage-utils": "^0.1.0" | ||
}, | ||
"gitHead": "fc41263499919b5666630f1d76cc0844eae7370e" | ||
} |
@@ -0,18 +1,15 @@ | ||
<!-- | ||
title: Javascript Cookie Utilities | ||
pageTitle: Cookie Utils | ||
description: Utility library for managing HTML cookies | ||
--> | ||
# Cookie Utilities | ||
[Tiny](https://bundlephobia.com/result?p=@analytics/cookie-utils) cookie utilities library for [analytics](https://npmjs.com/package/analytics) & whatever else 🌈 | ||
[Tiny](https://bundlephobia.com/result?p=@analytics/cookie-utils) cookie utility library with fallbacks. | ||
Exposes `getCookie`, `setCookie`, `removeCookie`, & `hasCookieSupport` functions. | ||
This module will automatically fail back to global window storage if `cookies` are not available. | ||
This will work with [analytics](https://getanalytics.io) or as a standalone import in your code. | ||
Exposes `hasCookies`, `getCookie`, `setCookie`, & `removeCookie` functions. | ||
<!-- AUTO-GENERATED-CONTENT:START (TOC) --> | ||
- [How to install](#how-to-install) | ||
- [API](#api) | ||
- [`getCookie`](#getcookie) | ||
- [`setCookie`](#setcookie) | ||
- [`deleteCookie`](#deletecookie) | ||
- [`hasCookieSupport`](#hascookiesupport) | ||
<!-- AUTO-GENERATED-CONTENT:END --> | ||
## How to install | ||
@@ -30,2 +27,15 @@ | ||
## `hasCookies` | ||
Check if cookies are supported. Will verify browser will accept cookies | ||
```js | ||
import { hasCookies } from '@analytics/cookie-utils' | ||
if (hasCookies()) { | ||
// Use them 🍪 | ||
} | ||
``` | ||
## `getCookie` | ||
@@ -63,14 +73,2 @@ | ||
deleteCookie('cookie-key') | ||
``` | ||
## `hasCookieSupport` | ||
Check if cookies are supported. Will verify browser will accept cookies | ||
```js | ||
import { hasCookieSupport } from '@analytics/cookie-utils' | ||
if (hasCookieSupport()) { | ||
// Use them 🍪 | ||
} | ||
``` | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
296014
1763.83%13
30%6870
2213.13%1
Infinity%4
100%4
300%72
-4%1
Infinity%1
Infinity%+ Added
+ Added