{"id":16834713,"url":"https://github.com/mscdex/groan","last_synced_at":"2025-03-22T04:30:46.118Z","repository":{"id":57254334,"uuid":"2531711","full_name":"mscdex/groan","owner":"mscdex","description":"A PHP session file parser written in JavaScript","archived":false,"fork":false,"pushed_at":"2013-09-09T14:43:26.000Z","size":128,"stargazers_count":24,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T08:11:17.263Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mscdex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-10-07T10:18:16.000Z","updated_at":"2024-04-07T12:04:32.000Z","dependencies_parsed_at":"2022-08-31T08:31:49.681Z","dependency_job_id":null,"html_url":"https://github.com/mscdex/groan","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fgroan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fgroan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fgroan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fgroan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mscdex","download_url":"https://codeload.github.com/mscdex/groan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244907420,"owners_count":20529850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T12:07:32.570Z","updated_at":"2025-03-22T04:30:45.714Z","avatar_url":"https://github.com/mscdex.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Description\n===========\n\ngroan is a PHP session file parser written in JavaScript.\n\n\nRequirements\n============\n\n* JavaScript (compatible with [node.js](http://nodejs.org/))\n\n\nNode.JS Examples\n================\n\n```javascript\nvar fs = require('fs'),\n    parser = require('groan');\n\n/*\n  ideally you should first ensure (session file's\n  mtime + PHP's session.gc_maxlifetime) \u003e Date.now() to ensure that the\n  session has not expired yet\n*/\n\n// if it is still valid, continue on ...\nfs.readFile('/tmp/sess_1234567890abcdef', function(err, b) {\n  if (err) throw err;\n  console.dir(parser(b.toString('utf8')));\n  /*\n     for a $_SESSION that contains:\n        [\"0\"]=\u003e\n        string(3) \"foo\"\n        [\"a\"]=\u003e\n        string(5) \"apple\"\n        [\"b\"]=\u003e\n        bool(false)\n        [\"c\"]=\u003e\n        array(3) {\n          [0]=\u003e\n          int(17)\n          [1]=\u003e\n          float(1.5)\n          [2]=\u003e\n          string(1) \"x\"\n        }\n        [\"d\"]=\u003e\n        array(0) {\n        }\n\n    the parser will return an object that looks like:\n      {\n        0: 'foo',\n        a: 'apple',\n        b: false,\n        c: [ 17, 1.5, 'x' ],\n        d: []\n      }\n  */\n});\n```\n\n```javascript\nvar parser = require('groan');\n\nvar serialized = 'a:5:{i:0;s:3:\"foo\";s:1:\"a\";s:5:\"apple\";s:1:\"b\";b:0;s:1:\"c\";a:3:{i:0;i:17;i:1;d:1.5;i:2;s:1:\"x\";}s:1:\"d\";a:0:{}}';\nconsole.dir(parser(serialized));\n\n// output:\n// { '0': 'foo', a: 'apple', b: false, c: [ 17, 1.5, 'x' ], d: [] }\n```\n\n\nNotes\n=====\n\n* References and recursion are not currently supported (currently returns `undefined`)\n\n* The parser assumes the session file data is in the valid PHP session serialized format\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscdex%2Fgroan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmscdex%2Fgroan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscdex%2Fgroan/lists"}