{"action":"created","issue":{"url":"https://api.github.com/repos/janogonzalez/ringbufferjs/issues/1","repository_url":"https://api.github.com/repos/janogonzalez/ringbufferjs","labels_url":"https://api.github.com/repos/janogonzalez/ringbufferjs/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/janogonzalez/ringbufferjs/issues/1/comments","events_url":"https://api.github.com/repos/janogonzalez/ringbufferjs/issues/1/events","html_url":"https://github.com/janogonzalez/ringbufferjs/pull/1","id":59419123,"number":1,"title":"Added #peek(count) to get more than 1 elements","user":{"login":"fastest963","id":112555,"avatar_url":"https://avatars.githubusercontent.com/u/112555?v=3","gravatar_id":"","url":"https://api.github.com/users/fastest963","html_url":"https://github.com/fastest963","followers_url":"https://api.github.com/users/fastest963/followers","following_url":"https://api.github.com/users/fastest963/following{/other_user}","gists_url":"https://api.github.com/users/fastest963/gists{/gist_id}","starred_url":"https://api.github.com/users/fastest963/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastest963/subscriptions","organizations_url":"https://api.github.com/users/fastest963/orgs","repos_url":"https://api.github.com/users/fastest963/repos","events_url":"https://api.github.com/users/fastest963/events{/privacy}","received_events_url":"https://api.github.com/users/fastest963/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2015-03-01T21:44:45Z","updated_at":"2016-07-27T13:26:49Z","closed_at":"2016-07-27T13:26:49Z","pull_request":{"url":"https://api.github.com/repos/janogonzalez/ringbufferjs/pulls/1","html_url":"https://github.com/janogonzalez/ringbufferjs/pull/1","diff_url":"https://github.com/janogonzalez/ringbufferjs/pull/1.diff","patch_url":"https://github.com/janogonzalez/ringbufferjs/pull/1.patch"},"body":"Use case: If you're building a chat server and want new clients to get the last 3 messages upon joining you would do something like:\r\n```JS\r\nvar buffer = new RingBuffer(3);\r\nfunction onJoin(client) {\r\n    var msgs = buffer.peek(buffer.size());\r\n    client.write(msgs.join(\"\\n\"));\r\n}\r\n```\r\n\r\nI tested using `npm test` but couldn't test in the browser since I don't have the build directory I guess? It just kept complaining about `require()` not being defined."},"comment":{"url":"https://api.github.com/repos/janogonzalez/ringbufferjs/issues/comments/235584093","html_url":"https://github.com/janogonzalez/ringbufferjs/pull/1#issuecomment-235584093","issue_url":"https://api.github.com/repos/janogonzalez/ringbufferjs/issues/1","id":235584093,"user":{"login":"janogonzalez","id":333524,"avatar_url":"https://avatars.githubusercontent.com/u/333524?v=3","gravatar_id":"","url":"https://api.github.com/users/janogonzalez","html_url":"https://github.com/janogonzalez","followers_url":"https://api.github.com/users/janogonzalez/followers","following_url":"https://api.github.com/users/janogonzalez/following{/other_user}","gists_url":"https://api.github.com/users/janogonzalez/gists{/gist_id}","starred_url":"https://api.github.com/users/janogonzalez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janogonzalez/subscriptions","organizations_url":"https://api.github.com/users/janogonzalez/orgs","repos_url":"https://api.github.com/users/janogonzalez/repos","events_url":"https://api.github.com/users/janogonzalez/events{/privacy}","received_events_url":"https://api.github.com/users/janogonzalez/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T13:26:49Z","updated_at":"2016-07-27T13:26:49Z","body":"closing for lack of activity"}}
{"actor":{"display_login":"janogonzalez"}}