{"_id":"express-state","_rev":"259999","name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"time":{"modified":"2021-06-03T16:41:37.000Z","created":"2013-05-02T20:15:05.354Z","2.0.0":"2020-04-29T03:35:28.763Z","1.4.0":"2016-05-31T22:04:27.356Z","1.3.0":"2015-08-26T20:44:18.341Z","1.2.0":"2014-04-29T00:18:15.433Z","1.1.4":"2014-04-03T23:01:47.676Z","1.1.3":"2014-03-06T23:34:44.937Z","1.1.2":"2014-02-21T05:33:46.748Z","1.1.1":"2014-01-25T20:48:39.740Z","1.1.0":"2014-01-23T03:24:08.589Z","1.0.3":"2013-12-04T17:22:03.653Z","1.0.2":"2013-11-05T05:47:59.933Z","1.0.1":"2013-10-16T21:55:54.420Z","1.0.0":"2013-08-16T02:50:28.484Z","0.0.4":"2013-07-29T19:46:58.176Z","0.0.3":"2013-06-09T03:01:12.925Z","0.0.2":"2013-05-03T21:29:36.783Z","0.0.1":"2013-05-02T20:15:05.354Z"},"users":{"intuitivcloud":true,"martinspinks":true,"jk6":true,"iamninad":true},"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"versions":{"2.0.0":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"2.0.0","licenses":[{"type":"BSD","url":"https://github.com/yahoo/express-state/blob/master/LICENSE"}],"homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","configuration","json","javascript","model","modown"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=10.x.x","npm":">=6.x.x"},"peerDependencies":{"express":">=3.x"},"dependencies":{"serialize-javascript":"^3.0.0"},"devDependencies":{"chai":"*","express":"4.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*","benchmark":"~1.0.0"},"scripts":{"test":"istanbul cover -- ./node_modules/mocha/bin/_mocha test/unit/ --reporter spec","benchmark":"node test/benchmark/serialize.js"},"gitHead":"727262e30001460b426510d04524015d224eec97","_id":"express-state@2.0.0","_nodeVersion":"12.16.2","_npmVersion":"6.14.4","_npmUser":{"name":"redonkulus","email":"seth@bertalotto.net"},"dist":{"shasum":"c3a0a02904f6f606c613392e5124e275327f21c7","size":13766,"noattachment":false,"key":"/express-state/-/express-state-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-2.0.0.tgz"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/express-state_2.0.0_1588131328630_0.41664490051061276"},"_hasShrinkwrap":false,"publish_time":1588131328763,"_cnpm_publish_time":1588131328763},"1.4.0":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"1.4.0","licenses":[{"type":"BSD","url":"https://github.com/yahoo/express-state/blob/master/LICENSE"}],"homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","configuration","json","javascript","model","modown"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":">=3.x"},"dependencies":{"serialize-javascript":"^1.1.0"},"devDependencies":{"chai":"*","express":"4.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*","benchmark":"~1.0.0"},"scripts":{"test":"istanbul cover -- ./node_modules/mocha/bin/_mocha test/unit/ --reporter spec","benchmark":"node test/benchmark/serialize.js"},"gitHead":"20e968dcd18c374e24c5948d902db03cbea1aadb","_id":"express-state@1.4.0","_shasum":"3ae100132ae11fdfef836fe190cab7ba729d227d","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"dist":{"shasum":"3ae100132ae11fdfef836fe190cab7ba729d227d","size":8380,"noattachment":false,"key":"/express-state/-/express-state-1.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-1.4.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/express-state-1.4.0.tgz_1464732266129_0.18897360167466104"},"publish_time":1464732267356,"_cnpm_publish_time":1464732267356,"_hasShrinkwrap":false},"1.3.0":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"1.3.0","licenses":[{"type":"BSD","url":"https://github.com/yahoo/express-state/blob/master/LICENSE"}],"homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","configuration","json","javascript","model","modown"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":">=3.x"},"dependencies":{"serialize-javascript":"~1.1.0"},"devDependencies":{"chai":"*","express":"4.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*","benchmark":"~1.0.0"},"scripts":{"test":"istanbul cover -- ./node_modules/mocha/bin/_mocha test/unit/ --reporter spec","benchmark":"node test/benchmark/serialize.js"},"gitHead":"e41b93b9322855255b023547636dcdcbf379822b","_id":"express-state@1.3.0","_shasum":"d763e06a1b0309c57eba56cdfe246ef12fda6782","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"dist":{"shasum":"d763e06a1b0309c57eba56cdfe246ef12fda6782","size":8207,"noattachment":false,"key":"/express-state/-/express-state-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-1.3.0.tgz"},"publish_time":1440621858341,"_cnpm_publish_time":1440621858341,"_hasShrinkwrap":false},"1.2.0":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"1.2.0","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","configuration","json","javascript","model","modown"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":">=3.x"},"devDependencies":{"chai":"*","express":"4.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*","benchmark":"~1.0.0"},"scripts":{"test":"istanbul cover -- ./node_modules/mocha/bin/_mocha test/unit/ --reporter spec","benchmark":"node test/benchmark/serialize.js"},"_id":"express-state@1.2.0","dist":{"shasum":"9fb02e0614ec9d12f690b11a2c12e9e7f6db8204","size":14088,"noattachment":false,"key":"/express-state/-/express-state-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-1.2.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1398730695433,"_cnpm_publish_time":1398730695433,"_hasShrinkwrap":false},"1.1.4":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"1.1.4","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","configuration","json","javascript","model","modown"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"*","express":"3.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*","benchmark":"~1.0.0"},"scripts":{"test":"istanbul cover -- ./node_modules/mocha/bin/_mocha test/unit/ --reporter spec","benchmark":"node test/benchmark/serialize.js"},"_id":"express-state@1.1.4","dist":{"shasum":"36d87e80381436dcebadffebb78efd53ab047362","size":14016,"noattachment":false,"key":"/express-state/-/express-state-1.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-1.1.4.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1396566107676,"_cnpm_publish_time":1396566107676,"_hasShrinkwrap":false},"1.1.3":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"1.1.3","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","configuration","json","javascript","model","modown"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"*","express":"3.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*","benchmark":"~1.0.0"},"scripts":{"test":"istanbul cover -- ./node_modules/mocha/bin/_mocha test/unit/ --reporter spec","benchmark":"node test/benchmark/serialize.js"},"_id":"express-state@1.1.3","dist":{"shasum":"80adda05db55b288292858f5199511846a8a1058","size":13744,"noattachment":false,"key":"/express-state/-/express-state-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-1.1.3.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1394148884937,"_cnpm_publish_time":1394148884937,"_hasShrinkwrap":false},"1.1.2":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"1.1.2","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","configuration","json","javascript","model","modown"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"*","express":"3.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*","benchmark":"~1.0.0"},"scripts":{"test":"istanbul cover -- ./node_modules/mocha/bin/_mocha test/unit/ --reporter spec","benchmark":"node test/benchmark/serialize.js"},"_id":"express-state@1.1.2","dist":{"shasum":"3896f4180c5433065ddfba1bf097b30b70b210d9","size":13534,"noattachment":false,"key":"/express-state/-/express-state-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-1.1.2.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1392960826748,"_cnpm_publish_time":1392960826748,"_hasShrinkwrap":false},"1.1.1":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"1.1.1","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","configuration","json","javascript","model","modown"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"*","express":"3.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*","benchmark":"~1.0.0"},"scripts":{"test":"istanbul cover -- ./node_modules/mocha/bin/_mocha test/unit/ --reporter spec","benchmark":"node test/benchmark/serialize.js"},"_id":"express-state@1.1.1","dist":{"shasum":"5d4a8856f21912adde66a0f4ee697543a0f422e0","size":13380,"noattachment":false,"key":"/express-state/-/express-state-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-1.1.1.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1390682919740,"_cnpm_publish_time":1390682919740,"_hasShrinkwrap":false},"1.1.0":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"1.1.0","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","configuration","json","javascript","model","modown"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"*","express":"3.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*","benchmark":"~1.0.0"},"scripts":{"test":"istanbul cover -- ./node_modules/mocha/bin/_mocha test/unit/ --reporter spec","benchmark":"node test/benchmark/serialize.js"},"_id":"express-state@1.1.0","dist":{"shasum":"828ca08a6989cae3a3be2bb4d5b819c29b7d0697","size":13215,"noattachment":false,"key":"/express-state/-/express-state-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-1.1.0.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1390447448589,"_cnpm_publish_time":1390447448589,"_hasShrinkwrap":false},"1.0.3":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"1.0.3","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","configuration","json","javascript","model","modown"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"*","express":"3.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*"},"scripts":{"test":"istanbul cover -- ./node_modules/mocha/bin/_mocha test/ --reporter spec"},"readmeFilename":"README.md","_id":"express-state@1.0.3","dist":{"shasum":"b6f368743a95d8a91b7683adf593d02b1577ec02","size":11326,"noattachment":false,"key":"/express-state/-/express-state-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-1.0.3.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1386177723653,"_cnpm_publish_time":1386177723653,"_hasShrinkwrap":false},"1.0.2":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"1.0.2","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","configuration","json","javascript","model","modown"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"*","express":"3.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js cover -- ./node_modules/.bin/_mocha test/*.js --reporter spec"},"readmeFilename":"README.md","_id":"express-state@1.0.2","dist":{"shasum":"c7d57f48ce6da8f9447cb4c56222876b1ed86df7","size":1048541,"noattachment":false,"key":"/express-state/-/express-state-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-1.0.2.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1383630479933,"_cnpm_publish_time":1383630479933,"_hasShrinkwrap":false},"1.0.1":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"1.0.1","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","configuration","javascript","model","json"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"*","express":"3.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js cover -- ./node_modules/.bin/_mocha test/*.js --reporter spec"},"readmeFilename":"README.md","_id":"express-state@1.0.1","dist":{"shasum":"de9d74c6f04f82ddd37ef6202ee909143f4a06ae","size":1048429,"noattachment":false,"key":"/express-state/-/express-state-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-1.0.1.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1381960554420,"_cnpm_publish_time":1381960554420,"_hasShrinkwrap":false},"1.0.0":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"1.0.0","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","configuration","javascript","model","json"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"*","express":"3.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js cover -- ./node_modules/.bin/_mocha test/*.js --reporter spec"},"readmeFilename":"README.md","_id":"express-state@1.0.0","dist":{"shasum":"b317c8ce605b77ff5e0f0b12523dbccd15853787","size":13812,"noattachment":false,"key":"/express-state/-/express-state-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-1.0.0.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1376621428484,"_cnpm_publish_time":1376621428484,"_hasShrinkwrap":false},"0.0.4":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"0.0.4","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","javascript","model","json"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"*","express":"3.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js cover -- ./node_modules/.bin/_mocha test/*.js --reporter spec"},"readmeFilename":"README.md","_id":"express-state@0.0.4","dist":{"shasum":"a1e1036875887c7f5b09e79578af12216ef3ea09","size":8718,"noattachment":false,"key":"/express-state/-/express-state-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-0.0.4.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1375127218176,"_cnpm_publish_time":1375127218176,"_hasShrinkwrap":false},"0.0.3":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"0.0.3","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","javascript","model","json"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"git://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"*","express":"3.x","express3-handlebars":"*","istanbul":"*","mocha":"*","mockery":"*","xunit-file":"*"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js cover -- ./node_modules/.bin/_mocha test/*.js --reporter spec"},"readmeFilename":"README.md","_id":"express-state@0.0.3","dist":{"shasum":"d21344fa0d34295085ac7ede5855464d54de50c9","size":8249,"noattachment":false,"key":"/express-state/-/express-state-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-0.0.3.tgz"},"_from":".","_npmVersion":"1.2.22","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1370746872925,"_cnpm_publish_time":1370746872925,"_hasShrinkwrap":false},"0.0.2":{"name":"express-state","description":"Share server-side state with the client-side of an Express app via JavaScript.","version":"0.0.2","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","javascript","model","json"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"https://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"*","express":"3.x","express3-handlebars":"*","istanbul":"*","mocha":"*"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js cover -- ./node_modules/.bin/_mocha test/*.js --reporter spec"},"readmeFilename":"README.md","_id":"express-state@0.0.2","dist":{"shasum":"54fe36483f23c304ad64242a01e34a1b7f75bc0f","size":7669,"noattachment":false,"key":"/express-state/-/express-state-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-0.0.2.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1367616576783,"_cnpm_publish_time":1367616576783,"_hasShrinkwrap":false},"0.0.1":{"name":"express-state","description":"Expose an Express app's state via client-side JavaScript.","version":"0.0.1","homepage":"https://github.com/yahoo/express-state","keywords":["express","state","client","expose","data","config","javascript"],"author":{"name":"Eric Ferraiuolo","email":"eferraiuolo@gmail.com","url":"http://ericf.me/"},"main":"index","directories":{"lib":"./lib","example":"./examples"},"repository":{"type":"git","url":"https://github.com/yahoo/express-state.git"},"bugs":{"url":"https://github.com/yahoo/express-state/issues"},"engines":{"node":">=0.8.x","npm":">=1.2.10"},"peerDependencies":{"express":"3.x"},"devDependencies":{"chai":"*","express":"3.x","express3-handlebars":"*","istanbul":"*","mocha":"*"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js cover -- ./node_modules/.bin/_mocha test/*.js --reporter spec"},"readmeFilename":"README.md","_id":"express-state@0.0.1","dist":{"shasum":"80dc09e7b84999e15e0355d8859a7ccaa2936eea","size":7496,"noattachment":false,"key":"/express-state/-/express-state-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/express-state/download/express-state-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"ericf","email":"eferraiuolo@gmail.com"},"maintainers":[{"name":"caridy","email":"caridy@gmail.com"},{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"publish_time":1367525705354,"_cnpm_publish_time":1367525705354,"_hasShrinkwrap":false}},"readme":"Express State\n=============\n\n[![npm Version][npm-badge]][npm]\n[![Dependency Status][david-badge]][david]\n[![Build Status][travis-badge]][travis]\n\nShare configuration and state data of an [Express][] app with the client-side\nvia JavaScript.\n\n[npm]: https://www.npmjs.org/package/express-state\n[npm-badge]: https://img.shields.io/npm/v/express-state.svg?style=flat-square\n[david]: https://david-dm.org/yahoo/express-state\n[david-badge]: https://img.shields.io/david/yahoo/express-state.svg?style=flat-square\n[travis]: https://travis-ci.org/yahoo/express-state\n[travis-badge]: https://img.shields.io/travis/yahoo/express-state.svg?style=flat-square\n[Express]: https://github.com/visionmedia/express\n\n\nOverview\n--------\n\n### Goals\n\nExpress State is designed to make it easy to share configuration and state data\nfrom the server to the client. It can be used to share any data that needs to be\navailable to the client-side JavaScript code of the an app: e.g., the current\nuser, a CSRF token, model data, routes, etc.\n\nProgressively enhanced Web apps can be built by rendering an app's initial state\non the server and using Express State as the conduit through which the server\npasses data and control over to the client-side JavaScript code.\n\n### How It Works\n\nConfiguration and state data are exposed to client-side JavaScript via two\nmethods: `app.expose()` and `res.expose()`, both of which make the data\navailable on a special `state` \"locals\" object for views/templates to serialize\nand embed into HTML pages.\n\nWhen views/templates embed this exposed data into an HTML page, it is serialized\nas literal JavaScript. The JavaScript serialization format is limited to\nexpressions that initialize namespaces and the exposed data assigned to those\nnamespaces, which is a superset of JSON that includes regular expressions and\nfunctions.\n\n### Features\n\nExpress State was written because of the shortcomings of [express-expose][]. The\nfollowing is a list of features highlighting differences when compared with\n`express-expose`:\n\n- **An efficient and powerful serialization format:**\n  Literal JavaScript is used to namespace exposed data that is a superset of\n  JSON and includes regular expressions and functions. This avoids the cost of\n  allocating and parsing large JSON strings on the client and enables things\n  like sharing routes defined as regular expressions with a client-side URL\n  router.\n\n- **Smart namespacing:**\n  A root namespace can be set via an app's `state namespace` setting and it will\n  be prepended to namespaces passed to `expose()` unless they already contain it\n  or they start with `\"window.\"`. The \"global\" on to which the namespaces are\n  created can also be controlled.\n\n- **Precise data value overrides:**\n  Sub-values within exposed objects can be easily overridden without clobbering\n  the entire object. Request scoped values can even override data exposed at the\n  app's scope.\n\n- **Lazy serialization:**\n  Exposed data objects are stored by reference, making them \"live\" and allowing\n  their values to be updated even after the object has been exposed. Only the\n  namespaces and data that are still reachable after the series of `expose()`\n  calls will be serialized. Serialization can happen at anytime, on demand, by\n  calling the `toString()` method on `state` \"locals\" objects.\n\n  When data is not going to change the `{cache: true}` option can be set to\n  eagerly serialize exposed objects, making repeated `toString()` calls more efficient.\n\n- **Explicit extension of each Express app:** Express State's functionality has\n  to be explicitly added to an Express app via the exported `extend()` function.\n  This prevents problems in complex apps where multiple versions of Express\n  and/or multiple Express apps are used.\n\n\n[app.locals]: http://expressjs.com/api.html#app.locals\n[res.locals]: http://expressjs.com/api.html#res.locals\n[express-expose]: https://github.com/visionmedia/express-expose\n\n\nInstallation\n------------\n\nInstall using npm:\n\n```shell\n$ npm install express-state\n```\n\n\nUsage\n-----\n\n### Extending an Express App\n\nTo use Express State with an Express app, the app must first be extended. Use\nthe `extend()` method that Express State exports:\n\n```javascript\nvar express  = require('express'),\n    expstate = require('express-state'),\n\n    app = express();\n\nexpstate.extend(app);\n```\n\nOnce extended, the app will have the `app.expose()` method, and response objects\nwill have the `res.expose()` method.\n\n**Note:** It's perfectly fine for the same Express app to be extended more than\nonce; after the first time the app is extended, the subsequent `extend()` calls\nwill be noops.\n\n### Exposing Data\n\nData can be exposed at two different scopes: the app's scope, and a\nrequest/response's scope via `app.expose()` and `res.expose()` respectively.\n\nExpress State uses Express's built-in \"locals\" system. When data is exposed at\nthe app's scope, a special `app.locals.state` object is created and used as the\nbacking store for all `app.expose()` calls. Express also merges `app.locals`\nwith `res.locals` to create the `context` object in which views/templates are\nrendered. This means that, by default, data exposed at the app's scope will also\nbe present when rendering views/templates for _all_ requests.\n\nExpress State sets up a similar relationship using prototypal inheritance where\n`res.locals.state` inherits from `app.locals.state`. This means data exposed at\nthe request scope will also contain exposed data from the app's scope. If values\nfor the same namespace are exposed at both scopes, the request/response scope\ntakes precedence and shadows the value at the app's scope.\n\n#### Exposing App-Scoped Data\n\nWhen data that needs to be exposed to the client-side JavaScript code is _not_\nrequest-specific and should be available to all requests, it should be exposed\nat the app's scope using __`app.expose()`__.\n\nThe following example exposes a Flickr API key required by Flickr to identify\nrequests:\n\n```javascript\napp.expose({\n    api_key: '02348notreal2394879137872358bla'\n}, 'MY_APP.Flickr');\n```\n\nThe client-side JavaScript code can now look up the Flickr API key at\n`MY_APP.Flickr.api_key` when it needs to make a request to Flickr's API.\n\n#### Exposing Request-Scoped Data\n\nWhen data that needs to be exposed to the client-side JavaScript _is_\nrequest-specific, it should be exposed at the request/response's scope using\n__`res.expose()`__.\n\nThe following example shows how to create a middleware function to expose the\ncurrent person's Cross Site Request Forgery (CSRF) token—this is a best\npractice where the CSRF is used to validate HTTP requests that mutate state:\n\n```javascript\n// Add Express' packaged `cookieParser()`, `session()`, and `csrf()` middleware.\napp.use(express.cookieParser());\napp.use(express.session({secret: 'something secure, not this!'}));\napp.use(express.csrf());\n\n// Create a middleware function that will expose the CSRF token for the current\n// request only.\napp.use(function (req, res, next) {\n    res.expose(req.session._csrf, 'MY_APP.CSRF_TOKEN');\n    next();\n});\n```\n\nThe client-side JavaScript code can now add the `X-CSRF-Token` HTTP header with\nthe value at `MY_APP.CSRF_TOKEN` to all XHRs it makes to the server.\n\n#### Increase Performance of Unchanging or Static Data\n\nIt's common to expose app-scoped data which *will not change* during the\nlifecycle of the Express app instance. To improve per-request performance, this\nunchanging/static data can be eagerly serialized and cached by setting the\n__`{cache: true}`__ option:\n\n```js\nvar CONFIG = {\n    hostname : 'example.com',\n    someOther: 'constant value'\n};\n\napp.expose(CONFIG, 'MY_APP.config', {cache: true});\n```\n\nSetting this option allows Express State to optimize the serialization process\nby keeping the serialized value around and re-using it every time the\n`toString()` method is invoked (which happens for every request.)\n\n**Note:** When a large amount of data needs to be exposed to the client-side, it\nis recommended to come up with a strategy where _all_ data which is common to\nmost/every request be exposed at the app-scope with the `{cache: true}` option\nset.\n\n#### Untrusted User Input\n\n**Always escape untrusted user input to protected against XSS attacks!**\n\nExpress State provides a mechanism to expose configuration and state data as\nfirst-party JavaScript, which means any untrusted user input should be properly\nescaped based on the [OWASP HTML escaping recommendations][OWASP].\n\nExpress State will automatically encode any `<`, `>`, `/` characters within\nstring values of exposed data to their Unicode counterparts during\nserialization. This provides a basic level of protection against XSS attacks by\nnot allowing the `\"</script><script>\"` character sequence within an exposed\nstring value to be interpreted and cause the browser prematurely close a script\nelement and reopen a new one.\n\nEven with the basic XSS protection Express State provides, it's still important\nto _always_ escape untrusted user input.\n\n#### Exposing Functions\n\nExpress State allows for functions to be serialized and sent to the browser, but\nthis has a few limitations and practical constraints:\n\n* A `TypeError` will be thrown if a native built-in function is being\n  serialized, like the `Number` constructor. Native built-ins should be called\n  in wrapper functions, which can be serialized.\n\n* Functions should only be exposed if they are dependency free and monadic in\n  nature. The original scope in which a function defined is not guaranteed to be\n  present in the client-side environment. If a function references variables or\n  has other dependencies outside its scope, it's likely not to work properly.\n\n* Application code _should not_ be sent to the browser by exposing it via\n  Express State. That would be a misuse of this library and it's recommended\n  that client-side code be organized into serve-able files or modules allowing\n  the browser to download the code via standard `<script src=\"\">` elements or a\n  script loader.\n\n### Setting a Root Namespace\n\nA common practice is to set a root namespace for an app so all of its exposed\ndata is contained under one global variable in the client-side JavaScript code.\nA root namespace can be setup for an app using the `state namespace` setting:\n\n```javascript\napp.set('state namespace', 'MY_APP');\n```\n\nNow anytime data is exposed, the root namespace will be prepended unless it\nalready exists in the `namespace` passed into the `expose()` call or the\npassed-in `namespace` starts with `\"window.\"`.\n\nWith the above `\"MY_APP\"` root namespace, the following are all equivalent and\nresult in `MY_APP.foo === 123` in the client-side JavaScript:\n\n```javascript\n// These all have the same result on the client: `MY_APP.foo === 123`\napp.expose(123, 'foo');\napp.expose(123, 'MY_APP.foo');\napp.expose(123, 'window.MY_APP.foo');\n```\n\nSetting a root namespace helps keep code DRY and configurable at the app level\nwhile having the `\"window.\"` escape hatch for data that needs to be exposed at\na specific namespace on the client.\n\n### Overriding Exposed Values\n\nObjects that are exposed through either `expose()` method are stored by\nreference, and serialization is done lazily (unless the `{cache: true}` option\nwas set). This means the objects are still \"live\" after they've been exposed. An\nobject can be exposed early during the life cycle of a request and updated up\nuntil the response is sent.\n\nThe following is a contrived example, but shows how values can be overridden at\nany time and at any scope:\n\n```javascript\napp.expose({root: '/'}, 'url');\n\napp.use(function (req, res, next) {\n    res.expose(req.path, 'url.path');\n    res.expose(req.query, 'url.query');\n    next();\n});\n```\n\nOn the client, the resulting `url` object would look like the following for a\nrequest to the URL `\"/foo?bar=baz\"`:\n\n```javascript\n{ root: '/',\n  path: '/foo',\n  query: { bar: 'baz' } }\n```\n\nNotice how exposing values at the `url.path` and `url.query` namespaces did\n_not_ clobber the original `url` object exposed at the app's scope.\n\nHowever, previously exposed data can be completely clobbered by simply exposing\na new value at the same namespace. When this happens, Express State is smart\nenough to know it can release its references to the previous value objects and\nnot waste CPU and bytes serializing them.\n\n### Serialization\n\nExpress State serializes exposed data to literal executable JavaScript. The\nJavaScript produced during serialization is limited to expressions that\ninitialize namespaces and the exposed data assigned to those namespaces, which\nis a superset of JSON that includes regular expressions and functions.\n\nJavaScript, as the serialization format, is more powerful and efficient than\nJSON. It avoids the cost of allocating and parsing large JSON strings on the\nclient and enables things like sharing routes defined as regular expressions\nwith a client-side URL router.\n\nThe special `app.locals.state` and `res.locals.state` objects contain a custom\n`toString()` method implementation, which serializes the objects to JavaScript\nthat is human readable and can be embedded inside a `<script>` element in an\nHTML page.\n\nThe following example shows a series of `expose()` calls and the resulting\noutput from serialization:\n\n```javascript\napp.expose({bar: 'bar'}, 'foo');\napp.expose(/baz/, 'foo.baz');\napp.expose(function () { return 'bla'; }, 'a.very.big.ns');\n\n// Serialize `app.locals.state` and log the result.\nconsole.log(app.locals.state.toString());\n```\n\nThe output of the `console.log()` call would be:\n\n```javascript\n(function (root) {\n/* -- Data -- */\nroot.foo = {\"bar\":\"bar\"};\nroot.foo || (root.foo = {});\nroot.foo.baz = /baz/;\nroot.a || (root.a = {});\nroot.a.very || (root.a.very = {});\nroot.a.very.big || (root.a.very.big = {});\nroot.a.very.big.ns = function () { return 'bla'; };\n}(this));\n```\n\n**Note:** A `TypeError` will be thrown if a native built-in function is being\nserialized, like the `Number` constructor. Native built-ins should be called in\nwrapper functions, which can be serialized. See the [Exposing Functions][]\nsection.\n\n### Embedding Data in HTML with Templates\n\nTo pass along the exposed configuration and state data to the client-side\nJavaScript code, it needs to be embedded in a `<script>` element of the app's\nHTML pages.\n\nIn Express, `res.render()` is used to render a view/template and send the\nresponse to the client. When rendering, Express sets up a context, which is an\nobject resulting from merging `app.locals` with `res.locals`. This means the\nspecial __`state`__ object is available to the views/templates.\n\nThe following example is a basic [Handlebars][] template that renders the\nserialized `state` object:\n\n```html\n<!doctype html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>Test App</title>\n</head>\n\n<body>\n    <h1>Test App</h1>\n\n    <script>\n        {{{state}}}\n    </script>\n</body>\n</html>\n```\n\n**Note:** In this example triple-mustaches (`{{{ }}}`) are used so that\nHandlebars does _not_ HTML-escape the value. Handlebars will automatically call\nthe `toString()` method on the special `state` object, which renders the\nJavaScript. See the [Untrusted User Input][] section above.\n\n\n[Handlebars]: http://handlebarsjs.com/\n[OWASP]: http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet\n[Untrusted User Input]: #untrusted-user-input\n[Exposing Functions]: #exposing-functions\n\n\nExamples\n--------\n\n### [Basic Usage][]\n\nA runnable example of the most basic Express app that uses Express State.\n\n\n[Basic Usage]: https://github.com/yahoo/express-state/tree/master/examples/basic\n\n\nAPI\n---\n\n### Configuration and Defaults\n\nThe following properties are exported from the Express State module. Assigning\nvalues to these properties affects all Express apps extended with this Express\nState module instance. To set these values for a specific app, use\n[App Settings][].\n\n#### `local = \"state\"`\n\nA string property name on `app.locals` and `res.locals` where Express State\ncreates its special objects used to store and serialize exposed data.\n\nBy default, Express State will create these objects:\n\n* `app.locals.state`\n* `res.locals.state`\n\n#### `namespace = null`\n\nThe root namespace is a string that should be prepended on the namespaces\nprovided to `app.expose()` and `res.expose()` method calls. By default, no root\nnamespace is used, and namespaces are created directly on the global (`window`)\nobject in the browser.\n\nSee [Setting a Root Namespace][] for more details.\n\n### App Settings\n\nThe following settings use the [Express Settings][] feature and only apply to\nthe app which they are `set()`. These app settings take precedence over the\nExpress State's global configuration settings above.\n\n#### `state local`\n\nUse `state local` to create a property on `app.locals` and `res.locals` where\nExpress State creates its special objects used to store and serialize exposed\ndata.\n\nBy default, no value is set, so Express State's exported `local` configuration\nvalue is used.\n\nThe following example sets the locals properties to `app.locals.exposed` and\n`res.locals.exposed`:\n\n```javascript\napp.set('state local', 'exposed');\n```\n\n#### `state namespace`\n\nUse `state namespace` to create a root namespace that should be prepended on the\nnamespaces provided to `app.expose()` and `res.expose()` method calls. By\ndefault, no root namespace is used, and namespaces are created directly on the\nglobal (`window`) object in the browser.\n\nThe following example sets the root namespace to `\"MY_APP\"`:\n\n```javascript\napp.set('state namespace', 'MY_APP');\n```\n\nSee [Setting a Root Namespace][] for more details.\n\n### Static Methods\n\n#### `extend (app)`\n\nThis function is exported from the Express State module that extends the\nfunctionality of the specified Express `app` by adding the two `expose()`\nmethods: `app.expose()` and `res.expose()`.\n\nIt's perfectly fine for the same Express app to be extended more than once;\nafter the first time the app is extended, the subsequent `extend()` calls will\nbe noops.\n\n**Parameters:**\n\n* `app`: Express app instance to extend with Express State's functionality.\n\nSee [Extending an Express App][] for more details.\n\n### Methods\n\n#### `app.expose (obj, [namespace], [options])`\n\n#### `res.expose (obj, [namespace], [options])`\n\nThe two `expose()` methods behave the same, the only difference being what scope\nthe data is exposed, either the app's or at the request's scope.\n\nThese two methods are used to expose configuration and state to client-side\nJavaScript by making the data available on a special `state` \"locals\" object for\nviews/templates to serialize and embed into HTML pages.\n\nSee the [Untrusted User Input][] section above, and make sure untrusted user\ninput is _always_ escaped before it passed to this method.\n\n**Parameters:**\n\n* `obj`: Any serializable JavaScript object to be exposed to the client-side.\n\n* `[namespace]`: Optional string namespace where the `obj` should be exposed.\n  This namespace will be prefixed with any configured root namespace unless it\n  already contains the root namespace or starts with `\"window.\"`.\n\n* `[options]`: Options which can be specified as either the second or third\n  argument to this method, and may contain the following:\n\n    * `[cache]`: Optional boolean to signal that it's safe to cache the\n      serialized form of `obj` because it won't change during the lifecycle of\n      the `app` or `res` (depending on which `expose()` method is invoked.) The eagerly serialized result is cached to greatly optimize to speed of\n      repeated calls to the `toString()` method.\n\n    * `[local]`: Optional string name of the \"locals\" property on which to\n      expose the `obj`. This is used to specify a locals property other than the\n      configured or default (`\"state\"`) one.\n\n    * `[namespace]`: Used to specify a `namespace` (described above) when\n      `options` is passed as the second argument to this method.\n\n    * `[isJSON]`: Optional boolean to signal that the `obj` being serialized is\n      pure JSON data. This allows serialization to take a fast-path making it\n      over 3x faster.\n\n**Note:** A `TypeError` will be thrown if a native built-in function is being\nserialized, like the `Number` constructor. Native built-ins should be called in\nwrapper functions, which can be serialized. See the [Exposing Functions][]\nsection.\n\nSee [Exposing Data][] and [Overriding Exposed Values][] for more details.\n\n\n[App Settings]: #app-settings\n[Express Settings]: http://expressjs.com/api.html#app-settings\n[Setting a Root Namespace]: #setting-a-root-namespace\n[Extending an Express App]: #extending-an-express-app\n[Exposing Data]: #exposing-data\n[Overriding Exposed Values]: #overriding-exposed-values\n\n\nLicense\n-------\n\nThis software is free to use under the Yahoo! Inc. BSD license.\nSee the [LICENSE file][] for license text and copyright information.\n\n\n[LICENSE file]: https://github.com/yahoo/express-state/blob/master/LICENSE\n","_attachments":{},"homepage":"https://github.com/yahoo/express-state","bugs":{"url":"https://github.com/yahoo/express-state/issues"}}