clientconfig
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -21,3 +21,3 @@ (function(e){if("function"==typeof bootstrap)bootstrap("clientconfig",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeClientconfig=e}else"undefined"!=typeof window?window.clientconfig=e():global.clientconfig=e()})(function(){var define,ses,bootstrap,module,exports; | ||
var cookie = document.cookie, | ||
setPos = cookie.indexOf(name + '='), | ||
setPos = cookie.search(new RegExp('\\b' + name + '=')), | ||
stopPos = cookie.indexOf(';', setPos), | ||
@@ -24,0 +24,0 @@ res; |
@@ -5,3 +5,3 @@ { | ||
"description": "Simple way to pass config items from server to client", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"tags": [ | ||
@@ -16,9 +16,22 @@ "browser", | ||
"dependencies": { | ||
"cookie-getter": "0.0.2" | ||
"cookie-getter": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"precommit-hook": "0.3.4", | ||
"browserify": "2.18.1" | ||
"browserify": "2.18.1", | ||
"jshint": "^2.9.0", | ||
"precommit-hook": "latest", | ||
"tap-spec": "^4.1.0", | ||
"tape": "^4.2.0" | ||
}, | ||
"main": "./clientconfig.js" | ||
"main": "./clientconfig.js", | ||
"scripts": { | ||
"test": "node test/index.js | tap-spec", | ||
"lint": "jshint .", | ||
"validate": "npm ls" | ||
}, | ||
"pre-commit": [ | ||
"lint", | ||
"validate", | ||
"test" | ||
] | ||
} |
@@ -23,7 +23,7 @@ # clientconfig | ||
Clientconfig simply looks for a cookie named `config` parses it at JSON and immediately wipes it out to avoid burdening subsequent requests with that extra overhead. | ||
Clientconfig simply looks for a cookie named `config` parses it as JSON and immediately wipes it out to avoid burdening subsequent requests with that extra overhead. | ||
## How do I use it? | ||
On the serverside when serving up your reqeust set a cookie containing the values you'd like to pass to the client in JSON. | ||
On the server-side when serving up your request set a cookie containing the values you'd like to pass to the client in JSON. | ||
@@ -30,0 +30,0 @@ If you're using node.js, express and `getconfig` it'd work like this: |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6799
9
61
5
1
+ Addedcookie-getter@1.0.1(transitive)
- Removedcookie-getter@0.0.2(transitive)
Updatedcookie-getter@^1.0.0