{"action":"closed","issue":{"url":"https://api.github.com/repos/sindresorhus/first-chunk-stream/issues/1","labels_url":"https://api.github.com/repos/sindresorhus/first-chunk-stream/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/first-chunk-stream/issues/1/comments","events_url":"https://api.github.com/repos/sindresorhus/first-chunk-stream/issues/1/events","html_url":"https://github.com/sindresorhus/first-chunk-stream/issues/1","id":101916263,"number":1,"title":"Strict first chunk handling","user":{"login":"nfroidure","id":229633,"avatar_url":"https://avatars.githubusercontent.com/u/229633?v=3","gravatar_id":"","url":"https://api.github.com/users/nfroidure","html_url":"https://github.com/nfroidure","followers_url":"https://api.github.com/users/nfroidure/followers","following_url":"https://api.github.com/users/nfroidure/following{/other_user}","gists_url":"https://api.github.com/users/nfroidure/gists{/gist_id}","starred_url":"https://api.github.com/users/nfroidure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfroidure/subscriptions","organizations_url":"https://api.github.com/users/nfroidure/orgs","repos_url":"https://api.github.com/users/nfroidure/repos","events_url":"https://api.github.com/users/nfroidure/events{/privacy}","received_events_url":"https://api.github.com/users/nfroidure/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-08-19T15:08:26Z","updated_at":"2015-09-20T16:04:37Z","closed_at":"2015-09-20T16:04:37Z","body":"I'd like to be able to only receive the n first chunks and being able to remove/keep/change it.\r\n\r\nIt seems impossible to do it with the current implementation, mainly because it is a Transform stream and not a Duplex one that's used under the hood.\r\n\r\nWould you be open to a refactoring providing the following API:\r\n\r\n```\r\nvar FirstChunk = require('first-chunk-stream');\r\n\r\nvar fisrtChunkStream = new FirstChunk({\r\n  size: 7,\r\n}, function(err, buf, cb) {\r\n    // do something with the buffer\r\n   // Call the cb with it in arg to have it passed through or not to just remove it\r\n  cb(null, buf);\r\n});\r\n\r\n```\r\nUsing firstchunk()  to instanciate a new stream would also be possible. The ctor stuff would be unnecessary since the constructor would be directly available for extending it.\r\n"}}