{"_id":"no-js-analytics","_rev":"31-5d28975c7592e0d49544295881852a3c","name":"no-js-analytics","description":"Really basic visitor analytics for speed demons using express.","dist-tags":{"latest":"0.1.9"},"versions":{"0.1.0":{"name":"no-js-analytics","version":"0.1.0","author":{"name":"Juuso Haavisto","email":"juuso@mail.com"},"description":"Really basic visitor analytics for speed demons using express.","main":"./lib/middleware","repository":{"type":"git","url":"https://github.com/Jhsto/no-js-analytics.git"},"keywords":["analytics","middleware","express","nojs"],"dependencies":{"express":"3.0.x","moment":"1.7.2","express-useragent":"0.0.7"},"license":"MIT","engines":{"node":">=0.6"},"readme":"#no-js-analytics\n\nno-js-analytics is really basic visitor analytics for people not so interested in nice graphs and stuff like that, but ho would like to instead trade those few requests and page loading time for something more useful. no-js-analytics works even if a visitor does not have javascript enabled, which some may find self esteem improving, since all those security paranoids running noscript will be caught too. no-js-analytics requires no database, since all visitor information is held in **object**, genuinely named as db. This makes no-js-analytics easy to adopt and the basic fundamental of speed is met, as also the fact that visitor data will be lost in case of server crash or restart. Anyhow, the object containing the visitor statics is saved every two hours (by default) into logs, but no-js-analytics also provides an easy way to expose that data in nice JSON format to anywhere you like using the analytics.stats() method. Below is an example output:\n\n```\n{\n  \"Chrome\": {\n    \"views\": 17\n  },\n  \"Linux\": {\n    \"views\": 20\n  },\n  \"desktop\": {\n    \"views\": 39\n  },\n  \"/\": {\n    \"views\": 41\n  },\n  \"overall\": {\n    \"views\": 49\n  },\n  \"en-US\": {\n    \"views\": 49\n  },\n  \"/analytics\": {\n    \"views\": 8\n  },\n  \"Firefox\": {\n    \"views\": 11\n  },\n  \"Safari\": {\n    \"views\": 19\n  },\n  \"iPad\": {\n    \"views\": 4\n  },\n  \"mobile\": {\n    \"views\": 10\n  },\n  \"IE\": {\n    \"views\": 2\n  },\n  \"Microsoft Windows\": {\n    \"views\": 2\n  },\n  \"unknown\": {\n    \"views\": 9\n  },\n  \"Android\": {\n    \"views\": 6\n  },\n  \"Apple Mac\": {\n    \"views\": 8\n  }\n}\n```\n\n##Tests\n   I made two tests locally on the default express page and below are the results.  \n   [google analytics](http://snag.gy/WFO8T.jpg)  \n   [no-js-analytics](http://snag.gy/qctlQ.jpg)\n\n##Installation:   \n1. ```$ npm install no-js-analytics```\n\n##Usage:\n```javascript\nvar analytics = require('no-js-analytics');\n\napp.configure(function(){\n  ... (all your express configuration)\n  app.use(analytics);\n});\n```\n\n##Methods\n###analytics.save()\n   Writes the current data of db object into a new .txt file in ./analytics-logs\n###analytics.stats()\n   Renders the current data of db object in JSON format. For an example, you might want to show the data in /analytics page, which can easily be achieved as below.\n   ```\n   app.get('/analytics', function(req, res){\n   res.send(200, analytics.stats());\n   });\n   ```\n\nTop of these methods no-js-analytics automatically saves visitor information into a text file every two hours, as declared in milliseconds in lib/middleware.js on line 114. Below it you can also find the default interval of db flush, which is set to happen once in a day.\n\n###Contributing\n   Feel free to contribute new features, bug fixes or to my code syntax.\n\n###To-do\n1. Returning and new visitor counters\n2. Some nice way to represent the data and more robust data structure\n3. More analytic features\n4. Spread to additional frameworks and languages\n5. World domination and bye-bye to formal javascript analytics\n\n###License (MIT)\n   Copyright (c) 2013 Juuso Haavisto <juuso@mail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"no-js-analytics@0.1.0","dist":{"shasum":"3bfad016ac225f8c535d6d3bb26eac61f8a8de64","tarball":"https://registry.npmjs.org/no-js-analytics/-/no-js-analytics-0.1.0.tgz","integrity":"sha512-ubqVYsnsTcBwoo5CruSbYAGIDkMVrEDLrg/7smWHN49Tia0pI9klZh7K/IKecUp0kAGc/spmwDacCbFwjv/vzw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIByry3F3V3SPdjxlY5IsxfMcpwAcrwGelaNPvqxlZ0poAiEA3JI16eU6rju64b9tQblU8f4w2GoanU/OYs79+qRVbxA="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"jhsto","email":"juuso@mail.com"},"maintainers":[{"name":"jhsto","email":"juuso@mail.com"}],"directories":{}},"0.1.1":{"name":"no-js-analytics","version":"0.1.1","author":{"name":"Juuso Haavisto","email":"juuso@mail.com"},"description":"Really basic visitor analytics for speed demons using express.","main":"./lib/middleware","repository":{"type":"git","url":"https://github.com/Jhsto/no-js-analytics.git"},"keywords":["analytics","middleware","express","nojs"],"dependencies":{"express":"3.0.x","moment":"1.7.2","express-useragent":"0.0.7"},"license":"MIT","engines":{"node":">=0.6"},"readme":"#no-js-analytics\n\nno-js-analytics is really basic visitor analytics for people not so interested in nice graphs and stuff like that, but ho would like to instead trade those few requests and page loading time for something more useful. no-js-analytics works even if a visitor does not have javascript enabled, which some may find self esteem improving, because all those security paranoids running noscript will be caught too. no-js-analytics requires no database, because all visitor statics are held in **object**, genuinely named as db. This makes no-js-analytics easy to adopt and the basic fundamental of speed is met, as the fact that visitor data will be lost in case of server crash or restart. Anyhow, the object containing the visitor statics is saved every two hours (by default) into logs, but no-js-analytics provides an easy way to expose that data in nice JSON format to anywhere you like using the analytics.stats() method. Here is an example output:\n\n```\n{\n  \"Browser\": {\n    \"Firefox\": {\n      \"views\": 6\n    },\n    \"Safari\": {\n      \"views\": 11\n    },\n    \"IE\": {\n      \"views\": 6\n    },\n    \"Chrome\": {\n      \"views\": 1\n    }\n  },\n  \"Platform\": {\n    \"Microsoft Windows\": {\n      \"views\": 9\n    },\n    \"Apple Mac\": {\n      \"views\": 3\n    },\n    \"iPhone\": {\n      \"views\": 5\n    },\n    \"iPad\": {\n      \"views\": 3\n    },\n    \"Android\": {\n      \"views\": 3\n    },\n    \"Linux\": {\n      \"views\": 1\n    }\n  },\n  \"Type\": {\n    \"desktop\": {\n      \"views\": 13\n    },\n    \"mobile\": {\n      \"views\": 11\n    }\n  },\n  \"Path\": {\n    \"/\": {\n      \"views\": 20\n    },\n    \"/analytics\": {\n      \"views\": 4\n    }\n  },\n  \"Language\": {\n    \"en-US\": {\n      \"views\": 24\n    }\n  },\n  \"overall\": {\n    \"views\": 24\n  }\n}\n```\n\n##Tests\n   I made two tests locally on the default express page and below are the results.  \n   [google analytics](http://snag.gy/WFO8T.jpg)  \n   [no-js-analytics](http://snag.gy/qctlQ.jpg)\n\n##Installation:   \n```$ npm install no-js-analytics```\n\n##Usage:\n```javascript\nvar analytics = require('no-js-analytics');\n\napp.configure(function(){\n  ... (all your express configuration)\n  app.use(analytics);\n});\n```\n\n##Methods\n###analytics.save()\n   Writes the current data of db object into a new .txt file in ./analytics-logs\n###analytics.stats()\n   Renders the current data of db object in JSON format. For an example, you might want to show the data in /analytics page, which can easily be achieved as below.\n```\napp.get('/analytics', function(req, res){\n  res.send(200, analytics.stats());\n});\n```\n###Defaults\n   Top of these methods no-js-analytics automatically saves visitor information into a text file every two hours, declared in milliseconds at lib/middleware.js on line 114. Below it you can also find the default interval of db flush, which is set to happen once in a day.\n\n###To-do\n1. Returning and new visitor counters\n2. Some nice way to represent the data and more robust data structure\n3. More analytic features\n4. Spread to additional frameworks and languages\n5. World domination and bye-bye to formal javascript analytics\n\n###License (MIT)\n   Copyright (c) 2013 Juuso Haavisto <juuso@mail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"no-js-analytics@0.1.1","dist":{"shasum":"870d2b3faab8c9b557209271d90dc2d1d0df16bb","tarball":"https://registry.npmjs.org/no-js-analytics/-/no-js-analytics-0.1.1.tgz","integrity":"sha512-E5KXTt54BTbcorYDLbMm0pjWJGgCTLgDznW7bPeAeS2uV6dbbwlj/RXyZZC8me3fgI2hBqmjHPqZPQ4o9V2H9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+aFiUQldjPi9+NShrssbPWQG40faUo7ZDT+G+g1f6mgIgWE2MrTXe1Wtylj33TeE98PWOHzgr3h1dPc+bgG8Zbv4="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"jhsto","email":"juuso@mail.com"},"maintainers":[{"name":"jhsto","email":"juuso@mail.com"}],"directories":{}},"0.1.2":{"name":"no-js-analytics","version":"0.1.2","author":{"name":"Juuso Haavisto","email":"juuso@mail.com"},"description":"Really basic visitor analytics for speed demons using express.","main":"./lib/middleware","repository":{"type":"git","url":"https://github.com/Jhsto/no-js-analytics.git"},"keywords":["analytics","middleware","express","nojs"],"dependencies":{"express":"3.0.x","moment":"1.7.2","express-useragent":"0.0.7"},"license":"MIT","engines":{"node":">=0.6"},"readme":"#no-js-analytics\n\nno-js-analytics is really basic visitor analytics for people not so interested in nice graphs and stuff like that, but ho would like to instead trade those few requests and page loading time for something more useful. no-js-analytics works even if a visitor does not have javascript enabled, which some may find self esteem improving, because all those security paranoids running noscript will be caught too. no-js-analytics requires no database, because all visitor statics are held in **object**, genuinely named as db. This makes no-js-analytics easy to adopt and the basic fundamental of speed is met, as the fact that visitor data will be lost in case of server crash or restart. Anyhow, the object containing the visitor statics is saved every two hours (by default) into logs, but no-js-analytics provides an easy way to expose that data in nice JSON format to anywhere you like using the analytics.stats() method. Here is an example output:\n\n```\n{\n  \"Browser\": {\n    \"Firefox\": {\n      \"views\": 6\n    },\n    \"Safari\": {\n      \"views\": 11\n    },\n    \"IE\": {\n      \"views\": 6\n    },\n    \"Chrome\": {\n      \"views\": 1\n    }\n  },\n  \"Platform\": {\n    \"Microsoft Windows\": {\n      \"views\": 9\n    },\n    \"Apple Mac\": {\n      \"views\": 3\n    },\n    \"iPhone\": {\n      \"views\": 5\n    },\n    \"iPad\": {\n      \"views\": 3\n    },\n    \"Android\": {\n      \"views\": 3\n    },\n    \"Linux\": {\n      \"views\": 1\n    }\n  },\n  \"Type\": {\n    \"desktop\": {\n      \"views\": 13\n    },\n    \"mobile\": {\n      \"views\": 11\n    }\n  },\n  \"Path\": {\n    \"/\": {\n      \"views\": 20\n    },\n    \"/analytics\": {\n      \"views\": 4\n    }\n  },\n  \"Language\": {\n    \"en-US\": {\n      \"views\": 24\n    }\n  },\n  \"overall\": {\n    \"views\": 24\n  }\n}\n```\n\n##Tests\n   I made two tests locally on the default express page and below are the results.  \n   [google analytics](http://snag.gy/WFO8T.jpg)  \n   [no-js-analytics](http://snag.gy/qctlQ.jpg)\n\n##Installation:   \n```$ npm install no-js-analytics```\n\n##Usage:\n```javascript\nvar analytics = require('no-js-analytics');\n\napp.configure(function(){\n  ... (all your express configuration)\n  app.use(analytics);\n});\n```\n\n##Methods\n###analytics.save()\n   Writes the current data of db object into a new .txt file in ./analytics-logs\n###analytics.stats()\n   Renders the current data of db object in JSON format. For an example, you might want to show the data in /analytics page, which can easily be achieved as below.\n```\napp.get('/analytics', function(req, res){\n  res.send(200, analytics.stats());\n});\n```\n###Defaults\n   Top of these methods no-js-analytics automatically saves visitor information into a text file every two hours, declared in milliseconds at lib/middleware.js on line 114. Below it you can also find the default interval of db flush, which is set to happen once in a day.\n\n###To-do\n1. Returning and new visitor counters\n2. Some nice way to represent the data and more robust data structure\n3. More analytic features\n4. Spread to additional frameworks and languages\n5. World domination and bye-bye to formal javascript analytics\n\n###License (MIT)\n   Copyright (c) 2013 Juuso Haavisto <juuso@mail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"no-js-analytics@0.1.2","dist":{"shasum":"e4a70369fa528d046b40024da4692ed0dead7b89","tarball":"https://registry.npmjs.org/no-js-analytics/-/no-js-analytics-0.1.2.tgz","integrity":"sha512-VJx7RPrcdiOw5MGmZZTMBy3jM1fXDBC6yPi5nR88RivWUE1W4DnqfytNgUTpvx3Aq6+Vb6sW9g9WSg5lQ2ObTw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG+P8cSN0ZOV2nWwEtN1TcJAehgrWD7S16uBzt1wl2QaAiEA0p8nbTOXWiUpt5v7Z5hWIbWQPCkdYRPPtAvu8xZSFKM="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"jhsto","email":"juuso@mail.com"},"maintainers":[{"name":"jhsto","email":"juuso@mail.com"}],"directories":{}},"0.1.3":{"name":"no-js-analytics","version":"0.1.3","author":{"name":"Juuso Haavisto","email":"juuso@mail.com"},"description":"Really basic visitor analytics for speed demons using express.","main":"./lib/middleware","repository":{"type":"git","url":"https://github.com/Jhsto/no-js-analytics.git"},"keywords":["analytics","middleware","express","nojs"],"dependencies":{"moment":"1.7.2","express-useragent":"0.0.7"},"license":"MIT","engines":{"node":">=0.6"},"readme":"#no-js-analytics\n\nno-js-analytics is really basic visitor analytics for people not so interested in nice graphs and stuff like that, but ho would like to instead trade those few requests and page loading time for something more useful. no-js-analytics works even if a visitor does not have javascript enabled, which some may find self esteem improving, because all those security paranoids running noscript will be caught too. no-js-analytics also saves statics of any call to API's and alike, without messing response data. no-js-analytics requires no database, because all visitor statics are held in **object**, geniously named as db. This makes no-js-analytics easy to adopt and the basic fundamental of speed is met, as the fact that visitor data will be lost in case of server crash or restart. Anyhow, the object containing the visitor statics is saved every two hours (by default) into logs, but no-js-analytics provides an easy way to expose that data in nice JSON format to anywhere you like using the analytics.stats() method. Here is an example output:\n\n```\n{\n  \"Browser\": {\n    \"Firefox\": {\n      \"views\": 6\n    },\n    \"Safari\": {\n      \"views\": 11\n    }\n  },\n  \"Platform\": {\n    \"Microsoft Windows\": {\n      \"views\": 9\n    },\n    \"Apple Mac\": {\n      \"views\": 3\n    },\n    \"iPhone\": {\n      \"views\": 5\n    }\n  },\n  \"Type\": {\n    \"desktop\": {\n      \"views\": 13\n    },\n    \"mobile\": {\n      \"views\": 11\n    }\n  },\n  \"Path\": {\n    \"/\": {\n      \"views\": 20\n    },\n    \"/analytics\": {\n      \"views\": 4\n    }\n  },\n  \"Language\": {\n    \"en-US\": {\n      \"views\": 24\n    }\n  },\n  \"overall\": {\n    \"views\": 24\n  }\n}\n```\n\n##Tests\n   I made two tests locally on the default express page and below are the results.  \n   [google analytics](http://snag.gy/WFO8T.jpg)  \n   [no-js-analytics](http://snag.gy/qctlQ.jpg)\n\n##Installation:   \n```$ npm install no-js-analytics```\n\n##Usage:\n```javascript\nvar analytics = require('no-js-analytics');\n\napp.configure(function(){\n  ... (all your express configuration)\n  app.use(analytics);\n});\n```\n\n##Methods\n###analytics.save()\n   Writes the current data of db object into a new .txt file in ./analytics-logs\n###analytics.stats()\n   Renders the current data of db object in JSON format. For an example, you might want to show the data in /analytics page, which can easily be achieved as below.\n```\napp.get('/analytics', function(req, res){\n  res.send(200, analytics.stats());\n});\n```\n###Defaults\n   Top of these methods no-js-analytics automatically saves visitor information into a text file every two hours, declared in milliseconds at lib/middleware.js. Below it you can also find the default interval of db flush, which is set to happen once in a day.\n\n###To-do\n1. Returning and new visitor counters\n2. Some nice way to represent the data and more robust data structure\n3. More analytic features\n4. Spread to additional frameworks and languages\n5. World domination and bye-bye to formal javascript analytics\n\n###License (MIT)\n   Copyright (c) 2013 Juuso Haavisto <juuso@mail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"no-js-analytics@0.1.3","dist":{"shasum":"d4788ef64669734b27a4b37b4514dc809fcd86a1","tarball":"https://registry.npmjs.org/no-js-analytics/-/no-js-analytics-0.1.3.tgz","integrity":"sha512-em56NlcFxd9hNxhKRRvtm+sRwquFaoCPxA2XGpXazhz63OHMruVTyFi21meE7yffV1ZZ8/Up1jfJ5K1afxSFhw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICCjCtd6aojF6G6oFUjxAgzO33X230vgrtMPbFWHmCffAiB9EMjb6AZv96e0HmL/qTiS1vg68a7DRNH6gH7b3T7RhQ=="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"jhsto","email":"juuso@mail.com"},"maintainers":[{"name":"jhsto","email":"juuso@mail.com"}],"directories":{}},"0.1.4":{"name":"no-js-analytics","version":"0.1.4","author":{"name":"Juuso Haavisto","email":"juuso@mail.com"},"description":"Really basic visitor analytics for speed demons using express.","main":"./lib/middleware","repository":{"type":"git","url":"https://github.com/Jhsto/no-js-analytics.git"},"keywords":["analytics","middleware","express","nojs"],"dependencies":{"moment":"1.7.2","express-useragent":"0.0.7"},"license":"MIT","engines":{"node":">=0.6"},"readme":"#no-js-analytics\n##simple analytics middleware for [express](http://expressjs.com/)\n\nno-js-analytics is really basic visitor analytics for people not so interested in nice graphs and stuff like that, but ho would like to instead trade those few requests and page loading time for something more useful. no-js-analytics works even if a visitor does not have javascript enabled, which some may find self esteem improving, because all those security paranoids running noscript will be caught too. no-js-analytics also saves statics of any call to API's and alike, without messing response data. no-js-analytics requires no database, because all visitor statics are held in **object**, geniously named as db. This makes no-js-analytics easy to adopt and the basic fundamental of speed is met, as the fact that visitor data will be lost in case of server crash or restart. Anyhow, the object containing the visitor statics is saved every two hours (by default) into logs, but no-js-analytics provides an easy way to expose that data in nice JSON format to anywhere you like using the analytics.stats() method. Here is an example output:\n\n```\n{\n  \"Browser\": {\n    \"Firefox\": {\n      \"views\": 6\n    },\n    \"Safari\": {\n      \"views\": 11\n    }\n  },\n  \"Platform\": {\n    \"Microsoft Windows\": {\n      \"views\": 9\n    },\n    \"Apple Mac\": {\n      \"views\": 3\n    },\n    \"iPhone\": {\n      \"views\": 5\n    }\n  },\n  \"Type\": {\n    \"desktop\": {\n      \"views\": 13\n    },\n    \"mobile\": {\n      \"views\": 11\n    }\n  },\n  \"Path\": {\n    \"/\": {\n      \"views\": 20\n    },\n    \"/analytics\": {\n      \"views\": 4\n    }\n  },\n  \"Language\": {\n    \"en-US\": {\n      \"views\": 24\n    }\n  },\n  \"overall\": {\n    \"views\": 24\n  }\n}\n```\n\n##Tests\n   I made two tests locally on the default express page and below are the results.  \n   [google analytics](http://snag.gy/WFO8T.jpg)  \n   [no-js-analytics](http://snag.gy/qctlQ.jpg)  \n   As you can see, the amount of requests went down by 4 and the overall response time reduced by 150ms - **locally**.\n\n##Installation:   \n```$ npm install no-js-analytics```\n\n##Usage:\n```javascript\nvar analytics = require('no-js-analytics');\n\napp.configure(function(){\n  ... (start of your express configuration)\n\n  app.use(express.bodyParser());\n  // Add analytics below express.bodyParser()\n  app.use(analytics);\n\n  ... (rest of your configurstion)\n});\n```\n\n##Methods\n###analytics.save()\n   Writes the current data of db object into a new .txt file in ./analytics-logs\n###analytics.stats()\n   Renders the current data of db object in JSON format. For an example, you might want to show the data in /analytics page, which can easily be achieved as below.\n```\napp.get('/analytics', function(req, res){\n  res.send(200, analytics.stats());\n});\n```\n###Defaults\n   Top of these methods no-js-analytics automatically saves visitor information into a text file every two hours, declared in milliseconds at lib/middleware.js. Below it you can also find the default interval of db flush, which is set to happen once in a day.\n\n###To-do\n1. Returning and new visitor counters\n2. Some nice way to represent the data and more robust data structure\n3. More analytic features\n4. Spread to additional frameworks and languages\n5. World domination and bye-bye to formal javascript analytics\n\n###License (MIT)\n   Copyright (c) 2013 Juuso Haavisto <juuso@mail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"no-js-analytics@0.1.4","dist":{"shasum":"74fe168978dc7920ebe8fb80549b5248cef21c97","tarball":"https://registry.npmjs.org/no-js-analytics/-/no-js-analytics-0.1.4.tgz","integrity":"sha512-te3lAT2v1Q0aZ4DLf418Z4YlO95BvtXZphqiZ01AfF8dvp9XkbzoYgB98xcBCSj7anuFwKs02utbnVmbDFGdZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCn/dWRnq4HMGZBzK3C3Y/kGCr+x08mUYQ1L81ESis7qwIhALcQePpy5Cg8lLABDPa6PGcUn9KQF66uxeMcr++ZDlUQ"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"jhsto","email":"juuso@mail.com"},"maintainers":[{"name":"jhsto","email":"juuso@mail.com"}],"directories":{}},"0.1.5":{"name":"no-js-analytics","version":"0.1.5","author":{"name":"Juuso Haavisto","email":"juuso@mail.com"},"description":"Really basic visitor analytics for speed demons using express.","main":"./lib/middleware","repository":{"type":"git","url":"https://github.com/Jhsto/no-js-analytics.git"},"keywords":["analytics","middleware","express","nojs"],"dependencies":{"moment":"1.7.2","express-useragent":"0.0.7"},"license":"MIT","engines":{"node":">=0.6"},"readme":"#no-js-analytics\n##simple analytics middleware for [express](http://expressjs.com/)\n\nno-js-analytics is really basic visitor analytics for people not so interested in nice graphs and stuff like that, but ho would like to instead trade those few requests and page loading time for something more useful. no-js-analytics works even if a visitor does not have javascript enabled, which some may find self esteem improving, because all those security paranoids running noscript will be caught too. no-js-analytics also saves statics of any call to API's and alike, without messing response data. no-js-analytics requires no database, because all visitor statics are held in **object**, geniously named as db. This makes no-js-analytics easy to adopt and the basic fundamental of speed is met, as the fact that visitor data will be lost in case of server crash or restart. Anyhow, the object containing the visitor statics is saved every two hours (by default) into logs, but no-js-analytics provides an easy way to expose that data in nice JSON format to anywhere you like using the analytics.stats() method. Here is an example output:\n\n```\n{\n  \"Browser\": {\n    \"Firefox\": {\n      \"views\": 6\n    },\n    \"Safari\": {\n      \"views\": 11\n    }\n  },\n  \"Platform\": {\n    \"Microsoft Windows\": {\n      \"views\": 9\n    },\n    \"Apple Mac\": {\n      \"views\": 3\n    },\n    \"iPhone\": {\n      \"views\": 5\n    }\n  },\n  \"Type\": {\n    \"desktop\": {\n      \"views\": 13\n    },\n    \"mobile\": {\n      \"views\": 11\n    }\n  },\n  \"Path\": {\n    \"/\": {\n      \"views\": 20\n    },\n    \"/analytics\": {\n      \"views\": 4\n    }\n  },\n  \"Language\": {\n    \"en-US\": {\n      \"views\": 24\n    }\n  },\n  \"overall\": {\n    \"views\": 24\n  }\n}\n```\n\n##Tests\n   I made two tests locally on the default express page and below are the results.  \n   [google analytics](http://snag.gy/WFO8T.jpg)  \n   [no-js-analytics](http://snag.gy/qctlQ.jpg)  \n   As you can see, the amount of requests went down by 4 and the overall response time reduced by 150ms - **locally**.\n\n##Installation:   \n```$ npm install no-js-analytics```\n\n##Usage:\n```javascript\nvar analytics = require('no-js-analytics');\n\napp.configure(function(){\n  ... (start of your express configuration)\n\n  app.use(express.bodyParser());\n  // Add analytics below express.bodyParser()\n  app.use(analytics);\n\n  ... (rest of your configuration)\n});\n```\n\n##Methods\n###analytics.save()\n   Writes the current data of db object into a new .txt file in ./analytics-logs\n###analytics.stats()\n   Renders the current data of db object in JSON format. For an example, you might want to show the data in /analytics page, which can easily be achieved as below.\n```\napp.get('/analytics', function(req, res){\n  res.send(200, analytics.stats());\n});\n```\n###Defaults\n   Top of these methods no-js-analytics automatically saves visitor information into a text file every two hours, declared in milliseconds at lib/middleware.js. Below it you can also find the default interval of db flush, which is set to happen once in a day.\n\n###To-do\n1. Returning and new visitor counters\n2. Some nice way to represent the data and more robust data structure\n3. More analytic features\n4. Spread to additional frameworks and languages\n5. World domination and bye-bye to formal javascript analytics\n\n###License (MIT)\n   Copyright (c) 2013 Juuso Haavisto <juuso@mail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"no-js-analytics@0.1.5","dist":{"shasum":"1d7d6b8517dba88937934a8e6003acf97c05a256","tarball":"https://registry.npmjs.org/no-js-analytics/-/no-js-analytics-0.1.5.tgz","integrity":"sha512-67BfsUrITMVfd55azt297ZyV3R4A3q+ab+m5y+oB7bk94kPO8k7UZT0FkK+t8pRj2hRGh/X6AnB/l4zG1gie1w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKeGnO3H6lltGik2L3SF8Xltd7UmicG5qXw2t6BNTPBAIga0SJj8IDL9QqXZrOBfjtDRRbxA7U+/+Rr22t8RtIuHk="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"jhsto","email":"juuso@mail.com"},"maintainers":[{"name":"jhsto","email":"juuso@mail.com"}],"directories":{}},"0.1.6":{"name":"no-js-analytics","version":"0.1.6","author":{"name":"Juuso Haavisto","email":"juuso@mail.com"},"description":"Really basic visitor analytics for speed demons using express.","main":"./lib/middleware","repository":{"type":"git","url":"https://github.com/Jhsto/no-js-analytics.git"},"keywords":["analytics","middleware","express","nojs"],"dependencies":{"moment":"1.7.2","express-useragent":"0.0.7"},"license":"MIT","engines":{"node":">=0.6"},"readme":"#no-js-analytics\n##simple analytics middleware for [express](http://expressjs.com/)\n\nno-js-analytics is really basic visitor analytics for people not so interested in nice graphs and stuff like that, but ho would like to instead trade those few requests and page loading time for something more useful. no-js-analytics works even if a visitor does not have javascript enabled, which some may find self esteem improving, because all those security paranoids running noscript will be caught too. no-js-analytics also saves statics of any call to API's and alike, without messing response data. no-js-analytics requires no database, because all visitor statics are held in **object**, geniously named as db. This makes no-js-analytics easy to adopt and the basic fundamental of speed is met, as the fact that visitor data will be lost in case of server crash or restart. Anyhow, the object containing the visitor statics is saved every two hours (by default) into logs, but no-js-analytics provides an easy way to expose that data in nice JSON format to anywhere you like using the analytics.stats() method. Here is an example output:\n\n```\n{\n  \"Browser\": {\n    \"Firefox\": {\n      \"views\": 6\n    },\n    \"Safari\": {\n      \"views\": 11\n    }\n  },\n  \"Platform\": {\n    \"Microsoft Windows\": {\n      \"views\": 9\n    },\n    \"Apple Mac\": {\n      \"views\": 3\n    },\n    \"iPhone\": {\n      \"views\": 5\n    }\n  },\n  \"Type\": {\n    \"desktop\": {\n      \"views\": 13\n    },\n    \"mobile\": {\n      \"views\": 11\n    }\n  },\n  \"Path\": {\n    \"/\": {\n      \"views\": 20\n    },\n    \"/analytics\": {\n      \"views\": 4\n    }\n  },\n  \"Language\": {\n    \"en-US\": {\n      \"views\": 24\n    }\n  },\n  \"overall\": {\n    \"views\": 24\n  }\n}\n```\n\n##Tests\n   I made two tests locally on the default express page and below are the results.  \n   [google analytics](http://snag.gy/WFO8T.jpg)  \n   [no-js-analytics](http://snag.gy/qctlQ.jpg)  \n   As you can see, the amount of requests went down by 4 and the overall response time reduced by 150ms - **locally**.\n\n##Installation:   \n```$ npm install no-js-analytics```\n\n##Usage:\n```javascript\nvar analytics = require('no-js-analytics');\n\napp.configure(function(){\n  ... (start of your express configuration)\n\n  app.use(express.bodyParser());\n  // Add analytics below express.bodyParser()\n  app.use(analytics);\n\n  ... (rest of your configuration)\n});\n```\n\n##Methods\n###analytics.save()\n   Writes the current data of db object into a new .txt file in ./analytics-logs\n###analytics.stats()\n   Renders the current data of db object in JSON format. For an example, you might want to show the data in /analytics page, which can easily be achieved as below.\n```\napp.get('/analytics', function(req, res){\n  res.send(200, analytics.stats());\n});\n```\n###Defaults\n   Top of these methods no-js-analytics automatically saves visitor information into a text file every two hours, declared in milliseconds at lib/middleware.js. Below it you can also find the default interval of db flush, which is set to happen once in a day.\n\n###To-do\n1. Returning and new visitor counters\n2. Some nice way to represent the data and more robust data structure\n3. More analytic features\n4. Spread to additional frameworks and languages\n5. World domination and bye-bye to formal javascript analytics\n\n###License (MIT)\n   Copyright (c) 2013 Juuso Haavisto <juuso@mail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"no-js-analytics@0.1.6","dist":{"shasum":"ecda5f8a8dc301c996de344ae22c9e2bd4eab868","tarball":"https://registry.npmjs.org/no-js-analytics/-/no-js-analytics-0.1.6.tgz","integrity":"sha512-Bh+rsULdBDu9w+flcMHoG9Uv0T8/9MpVlANzEWSEHVA9nVQGcDAOG1LRLc6gmUjMCucRr02fdKPK9HjpwWSz8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMXnLXywTIl8uzVc+dx2Fy0yUeMooxFb/4ocflmXsnBQIgXTZAhOGtEnmLZ7M4se2AyMUCDCGO/Jr059ubauRbMqk="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"jhsto","email":"juuso@mail.com"},"maintainers":[{"name":"jhsto","email":"juuso@mail.com"}],"directories":{}},"0.1.7":{"name":"no-js-analytics","version":"0.1.7","author":{"name":"Juuso Haavisto","email":"juuso@mail.com"},"description":"Really basic visitor analytics for speed demons using express.","main":"./lib/middleware","repository":{"type":"git","url":"https://github.com/Jhsto/no-js-analytics.git"},"keywords":["analytics","middleware","express","nojs"],"dependencies":{"moment":"1.7.2","express-useragent":"0.0.7"},"license":"MIT","engines":{"node":">=0.6"},"readme":"#no-js-analytics\n##simple analytics middleware for [express](http://expressjs.com/)\n\nno-js-analytics is really basic visitor analytics for people not so interested in nice graphs and stuff like that, but ho would like to instead trade those few requests and page loading time for something more useful. no-js-analytics works even if a visitor does not have javascript enabled, which some may find self esteem improving, because all those security paranoids running noscript will be caught too. no-js-analytics also saves statics of any call to API's and alike, without messing response data. no-js-analytics requires no database, because all visitor statics are held in **object**, geniously named as db. This makes no-js-analytics easy to adopt and the basic fundamental of speed is met, as the fact that visitor data will be lost in case of server crash or restart. Anyhow, the object containing the visitor statics is saved every two hours (by default) into logs, but no-js-analytics provides an easy way to expose that data in nice JSON format to anywhere you like using the analytics.stats() method. Here is an example output:\n\n```\n{\n  \"Browser\": {\n    \"Firefox\": {\n      \"views\": 6\n    },\n    \"Safari\": {\n      \"views\": 11\n    }\n  },\n  \"Platform\": {\n    \"Microsoft Windows\": {\n      \"views\": 9\n    },\n    \"Apple Mac\": {\n      \"views\": 3\n    },\n    \"iPhone\": {\n      \"views\": 5\n    }\n  },\n  \"Type\": {\n    \"desktop\": {\n      \"views\": 13\n    },\n    \"mobile\": {\n      \"views\": 11\n    }\n  },\n  \"Path\": {\n    \"/\": {\n      \"views\": 20\n    },\n    \"/analytics\": {\n      \"views\": 4\n    }\n  },\n  \"Language\": {\n    \"en-US\": {\n      \"views\": 24\n    }\n  },\n  \"overall\": {\n    \"views\": 24\n  }\n}\n```\n\n##Tests\n   I made two tests locally on the default express page and below are the results.  \n   [google analytics](http://snag.gy/WFO8T.jpg)  \n   [no-js-analytics](http://snag.gy/qctlQ.jpg)  \n   As you can see, the amount of requests went down by 4 and the overall response time reduced by 150ms - **locally**.\n\n##Installation:   \n```$ npm install no-js-analytics```\n\n##Usage:\n```javascript\nvar analytics = require('no-js-analytics');\n\napp.configure(function(){\n  ... (start of your express configuration)\n\n  app.use(express.bodyParser());\n  // Add analytics below express.bodyParser()\n  app.use(analytics);\n\n  ... (rest of your configuration)\n});\n```\n\n##Methods\n###analytics.save()\n   Writes the current data of db object into a new .txt file in ./analytics-logs\n###analytics.stats()\n   Renders the current data of db object in JSON format. For an example, you might want to show the data in /analytics page, which can easily be achieved as below.\n```\napp.get('/analytics', function(req, res){\n  res.send(200, analytics.stats());\n});\n```\n###Defaults\n   Top of these methods no-js-analytics automatically saves visitor information into a text file every two hours, declared in milliseconds at lib/middleware.js. Below it you can also find the default interval of db flush, which is set to happen once in a day.\n\n###To-do\n1. Returning and new visitor counters\n2. Some nice way to represent the data and more robust data structure\n3. More analytic features\n4. Spread to additional frameworks and languages\n5. World domination and bye-bye to formal javascript analytics\n\n###License (MIT)\n   Copyright (c) 2013 Juuso Haavisto <juuso@mail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"no-js-analytics@0.1.7","dist":{"shasum":"00457284bd9c8b9df0d35dd245f51acda26725c1","tarball":"https://registry.npmjs.org/no-js-analytics/-/no-js-analytics-0.1.7.tgz","integrity":"sha512-pdHkqboMEA5QAfas0ixdh1AX9W0oK5FTlqPoZz9fV1l3HAQeNhLZZM4IWr0mLxCCnUEjhWtUUZqjwh4jR+e+2w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE40ST/27kE0az2nemX4KMlQ/9T1Am3Sv55EgKrXfkogAiEAlzwVgQeF+j64QRz+C/f4OJgNCyjnu3MIaqxCoZxgmYs="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"jhsto","email":"juuso@mail.com"},"maintainers":[{"name":"jhsto","email":"juuso@mail.com"}],"directories":{}},"0.1.8":{"name":"no-js-analytics","version":"0.1.8","author":{"name":"Juuso Haavisto","email":"juuso@mail.com"},"description":"Really basic visitor analytics for speed demons using express.","main":"./lib/middleware","repository":{"type":"git","url":"https://github.com/Jhsto/no-js-analytics.git"},"keywords":["analytics","middleware","express","nojs"],"dependencies":{"moment":"1.7.2","express-useragent":"0.0.7","underscore.string":"2.3.0"},"license":"MIT","engines":{"node":">=0.6"},"readme":"#no-js-analytics\r\n##simple analytics middleware for [express](http://expressjs.com/)\r\n\r\nno-js-analytics is really basic visitor analytics for people not so interested in nice graphs and stuff like that, but ho would like to instead trade those few requests and page loading time for something more useful. no-js-analytics works even if a visitor does not have javascript enabled, which some may find self esteem improving, because all those security paranoids running noscript will be caught too. no-js-analytics also saves statics of any call to API's and alike, without messing response data. no-js-analytics requires no database, because all visitor statics are held in **object**, geniously named as db. This makes no-js-analytics easy to adopt and the basic fundamental of speed is met, as the fact that visitor data will be lost in case of server crash or restart. Anyhow, the object containing the visitor statics is saved every two hours (by default) into logs, but no-js-analytics provides an easy way to expose that data in nice JSON format to anywhere you like using the analytics.stats() method. Here is an example output:\r\n\r\n```\r\n{\r\n  \"Browser\": {\r\n    \"Firefox\": {\r\n      \"views\": 6\r\n    },\r\n    \"Safari\": {\r\n      \"views\": 11\r\n    }\r\n  },\r\n  \"Platform\": {\r\n    \"Microsoft Windows\": {\r\n      \"views\": 9\r\n    },\r\n    \"Apple Mac\": {\r\n      \"views\": 3\r\n    },\r\n    \"iPhone\": {\r\n      \"views\": 5\r\n    }\r\n  },\r\n  \"Type\": {\r\n    \"desktop\": {\r\n      \"views\": 13\r\n    },\r\n    \"mobile\": {\r\n      \"views\": 11\r\n    }\r\n  },\r\n  \"Path\": {\r\n    \"/\": {\r\n      \"views\": 20\r\n    },\r\n    \"/analytics\": {\r\n      \"views\": 4\r\n    }\r\n  },\r\n  \"Language\": {\r\n    \"en-US\": {\r\n      \"views\": 24\r\n    }\r\n  },\r\n  \"overall\": {\r\n    \"views\": 24\r\n  }\r\n}\r\n```\r\n\r\n##Tests\r\n   I made two tests locally on the default express page and below are the results.  \r\n   [google analytics](http://snag.gy/WFO8T.jpg)  \r\n   [no-js-analytics](http://snag.gy/qctlQ.jpg)  \r\n   As you can see, the amount of requests went down by 4 and the overall response time reduced by 150ms - **locally**.\r\n\r\n##Installation:   \r\n```$ npm install no-js-analytics```\r\n\r\n##Usage:\r\n```javascript\r\nvar analytics = require('no-js-analytics');\r\n\r\napp.configure(function(){\r\n  ... (start of your express configuration)\r\n\r\n  app.use(express.bodyParser());\r\n  // Add analytics below express.bodyParser()\r\n  app.use(analytics);\r\n\r\n  ... (rest of your configuration)\r\n});\r\n```\r\n\r\n##Methods\r\n###analytics.save()\r\n   Writes the current data of db object into a new .txt file in ./analytics-logs\r\n###analytics.stats()\r\n   Renders the current data of db object in JSON format. For an example, you might want to show the data in /analytics page, which can easily be achieved as below.\r\n```\r\napp.get('/analytics', function(req, res){\r\n  res.send(200, analytics.stats());\r\n});\r\n```\r\n###Defaults\r\n   Top of these methods no-js-analytics automatically saves visitor information into a text file every two hours, declared in milliseconds at lib/middleware.js. Below it you can also find the default interval of db flush, which is set to happen once in a day.\r\n\r\n###To-do\r\n1. Returning and new visitor counters\r\n2. Some nice way to represent the data and more robust data structure\r\n3. More analytic features\r\n4. Spread to additional frameworks and languages\r\n5. World domination and bye-bye to formal javascript analytics\r\n\r\n###License (MIT)\r\n   Copyright (c) 2013 Juuso Haavisto <juuso@mail.com>\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","_id":"no-js-analytics@0.1.8","dist":{"shasum":"23264d1c76d94f5db587fc37cd59065bc3bc447f","tarball":"https://registry.npmjs.org/no-js-analytics/-/no-js-analytics-0.1.8.tgz","integrity":"sha512-qZEyQe/t1/v3m/9SVzIbiOCXI8q+kzhtuOgtErhnqy+Gec9K9HSvo9ZIUbVTZrDhfLQlhRo9jyLmCdM5GLCz0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFYcBscPMy9odRNqmv+pCDsYqra5wvI7LQ5R5Me4W2pHAiEA8+IZYjFUiEru7SxyrNLxRxBu9pGS5nm4hTI+j99afNs="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"jhsto","email":"juuso@mail.com"},"maintainers":[{"name":"jhsto","email":"juuso@mail.com"}],"directories":{}},"0.1.9":{"name":"no-js-analytics","version":"0.1.9","author":{"name":"Juuso Haavisto","email":"juuso@mail.com"},"description":"Really basic visitor analytics for speed demons using express.","main":"./lib/middleware","repository":{"type":"git","url":"https://github.com/Jhsto/no-js-analytics.git"},"keywords":["analytics","middleware","express","nojs"],"dependencies":{"moment":"1.7.2","express-useragent":"0.0.7","underscore.string":"2.3.0"},"license":"MIT","engines":{"node":">=0.6"},"readme":"#no-js-analytics\r\n##simple analytics middleware for [express](http://expressjs.com/)\r\n\r\nno-js-analytics is really basic visitor analytics for people not so interested in nice graphs and stuff like that, but ho would like to instead trade those few requests and page loading time for something more useful. no-js-analytics works even if a visitor does not have javascript enabled, which some may find self esteem improving, because all those security paranoids running noscript will be caught too. no-js-analytics also saves statics of any call to API's and alike, without messing response data. no-js-analytics requires no database, because all visitor statics are held in **object**, geniously named as db. This makes no-js-analytics easy to adopt and the basic fundamental of speed is met, as the fact that visitor data will be lost in case of server crash or restart. Anyhow, the object containing the visitor statics is saved every two hours (by default) into logs, but no-js-analytics provides an easy way to expose that data in nice JSON format to anywhere you like using the analytics.stats() method. Here is an example output:\r\n\r\n```\r\n{\r\n  \"Browser\": {\r\n    \"Firefox\": {\r\n      \"views\": 6\r\n    },\r\n    \"Safari\": {\r\n      \"views\": 11\r\n    }\r\n  },\r\n  \"Platform\": {\r\n    \"Microsoft Windows\": {\r\n      \"views\": 9\r\n    },\r\n    \"Apple Mac\": {\r\n      \"views\": 3\r\n    },\r\n    \"iPhone\": {\r\n      \"views\": 5\r\n    }\r\n  },\r\n  \"Type\": {\r\n    \"desktop\": {\r\n      \"views\": 13\r\n    },\r\n    \"mobile\": {\r\n      \"views\": 11\r\n    }\r\n  },\r\n  \"Path\": {\r\n    \"/\": {\r\n      \"views\": 20\r\n    },\r\n    \"/analytics\": {\r\n      \"views\": 4\r\n    }\r\n  },\r\n  \"Language\": {\r\n    \"en-US\": {\r\n      \"views\": 24\r\n    }\r\n  },\r\n  \"overall\": {\r\n    \"views\": 24\r\n  }\r\n}\r\n```\r\n\r\n##Tests\r\n   I made two tests locally on the default express page and below are the results.  \r\n   [google analytics](http://snag.gy/WFO8T.jpg)  \r\n   [no-js-analytics](http://snag.gy/qctlQ.jpg)  \r\n   As you can see, the amount of requests went down by 4 and the overall response time reduced by 150ms - **locally**.\r\n\r\n##Installation:   \r\n```$ npm install no-js-analytics```\r\n\r\n##Usage:\r\n```javascript\r\nvar analytics = require('no-js-analytics');\r\n\r\napp.configure(function(){\r\n  ... (start of your express configuration)\r\n\r\n  app.use(express.bodyParser());\r\n  // Add analytics below express.bodyParser()\r\n  app.use(analytics);\r\n\r\n  ... (rest of your configuration)\r\n});\r\n```\r\n\r\n##Methods\r\n###analytics.save()\r\n   Writes the current data of db object into a new .txt file in ./analytics-logs\r\n###analytics.stats()\r\n   Renders the current data of db object in JSON format. For an example, you might want to show the data in /analytics page, which can easily be achieved as below.\r\n```\r\napp.get('/analytics', function(req, res){\r\n  res.send(200, analytics.stats());\r\n});\r\n```\r\n###Defaults\r\n   Top of these methods no-js-analytics automatically saves visitor information into a text file every two hours, declared in milliseconds at lib/middleware.js. Below it you can also find the default interval of db flush, which is set to happen once in a day.\r\n\r\n###To-do\r\n1. Returning and new visitor counters\r\n2. Some nice way to represent the data and more robust data structure\r\n3. More analytic features\r\n4. Spread to additional frameworks and languages\r\n5. World domination and bye-bye to formal javascript analytics\r\n\r\n###License (MIT)\r\n   Copyright (c) 2013 Juuso Haavisto <juuso@mail.com>\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n","readmeFilename":"README.md","_id":"no-js-analytics@0.1.9","dist":{"shasum":"4bf0a4936308ce283e92a40628c7328203232bf7","tarball":"https://registry.npmjs.org/no-js-analytics/-/no-js-analytics-0.1.9.tgz","integrity":"sha512-jdZ5H5IbPL13/EqXKaBm2kMN/wHYz1dvHi7xKeje8lBGkaNVQbpCCIki7aL0sA1PZ4/p8lx4hzsQjpCw9X5gUQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQtbnYV3wRvX+qmlo9ab7PsTAEAeYs/mxQwm0MPNu2bgIgJIsc0eOyIcUaaDPJcSlCM9StYn8V4/neMEurzhDgQJk="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"jhsto","email":"juuso@mail.com"},"maintainers":[{"name":"jhsto","email":"juuso@mail.com"}]}},"readme":"#no-js-analytics\n\nno-js-analytics is really basic visitor analytics for people not so interested in nice graphs and stuff like that, but ho would like to instead trade those few requests and page loading time for something more useful. no-js-analytics works even if a visitor does not have javascript enabled, which some may find self esteem improving, since all those security paranoids running noscript will be caught too. no-js-analytics requires no database, since all visitor information is held in **object**, genuinely named as db. This makes no-js-analytics easy to adopt and the basic fundamental of speed is met, as also the fact that visitor data will be lost in case of server crash or restart. Anyhow, the object containing the visitor statics is saved every two hours (by default) into logs, but no-js-analytics also provides an easy way to expose that data in nice JSON format to anywhere you like using the analytics.stats() method. Below is an example output:\n\n```\n{\n  \"Chrome\": {\n    \"views\": 17\n  },\n  \"Linux\": {\n    \"views\": 20\n  },\n  \"desktop\": {\n    \"views\": 39\n  },\n  \"/\": {\n    \"views\": 41\n  },\n  \"overall\": {\n    \"views\": 49\n  },\n  \"en-US\": {\n    \"views\": 49\n  },\n  \"/analytics\": {\n    \"views\": 8\n  },\n  \"Firefox\": {\n    \"views\": 11\n  },\n  \"Safari\": {\n    \"views\": 19\n  },\n  \"iPad\": {\n    \"views\": 4\n  },\n  \"mobile\": {\n    \"views\": 10\n  },\n  \"IE\": {\n    \"views\": 2\n  },\n  \"Microsoft Windows\": {\n    \"views\": 2\n  },\n  \"unknown\": {\n    \"views\": 9\n  },\n  \"Android\": {\n    \"views\": 6\n  },\n  \"Apple Mac\": {\n    \"views\": 8\n  }\n}\n```\n\n##Tests\n   I made two tests locally on the default express page and below are the results.  \n   [google analytics](http://snag.gy/WFO8T.jpg)  \n   [no-js-analytics](http://snag.gy/qctlQ.jpg)\n\n##Installation:   \n1. ```$ npm install no-js-analytics```\n\n##Usage:\n```javascript\nvar analytics = require('no-js-analytics');\n\napp.configure(function(){\n  ... (all your express configuration)\n  app.use(analytics);\n});\n```\n\n##Methods\n###analytics.save()\n   Writes the current data of db object into a new .txt file in ./analytics-logs\n###analytics.stats()\n   Renders the current data of db object in JSON format. For an example, you might want to show the data in /analytics page, which can easily be achieved as below.\n   ```\n   app.get('/analytics', function(req, res){\n   res.send(200, analytics.stats());\n   });\n   ```\n\nTop of these methods no-js-analytics automatically saves visitor information into a text file every two hours, as declared in milliseconds in lib/middleware.js on line 114. Below it you can also find the default interval of db flush, which is set to happen once in a day.\n\n###Contributing\n   Feel free to contribute new features, bug fixes or to my code syntax.\n\n###To-do\n1. Returning and new visitor counters\n2. Some nice way to represent the data and more robust data structure\n3. More analytic features\n4. Spread to additional frameworks and languages\n5. World domination and bye-bye to formal javascript analytics\n\n###License (MIT)\n   Copyright (c) 2013 Juuso Haavisto <juuso@mail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"jhsto","email":"juuso@mail.com"}],"time":{"modified":"2022-06-21T11:06:19.894Z","created":"2013-01-02T13:40:40.743Z","0.1.0":"2013-01-02T13:40:43.232Z","0.1.1":"2013-01-02T20:59:28.381Z","0.1.2":"2013-01-02T21:00:37.582Z","0.1.3":"2013-01-03T11:30:10.128Z","0.1.4":"2013-01-04T20:23:21.516Z","0.1.5":"2013-01-04T20:45:07.666Z","0.1.6":"2013-01-04T20:54:16.917Z","0.1.7":"2013-01-09T19:11:17.661Z","0.1.8":"2013-04-13T08:46:46.669Z","0.1.9":"2013-05-16T13:17:54.981Z"},"author":{"name":"Juuso Haavisto","email":"juuso@mail.com"},"repository":{"type":"git","url":"https://github.com/Jhsto/no-js-analytics.git"}}