{"action":"created","issue":{"url":"https://api.github.com/repos/substack/tape/issues/276","repository_url":"https://api.github.com/repos/substack/tape","labels_url":"https://api.github.com/repos/substack/tape/issues/276/labels{/name}","comments_url":"https://api.github.com/repos/substack/tape/issues/276/comments","events_url":"https://api.github.com/repos/substack/tape/issues/276/events","html_url":"https://github.com/substack/tape/pull/276","id":143332246,"number":276,"title":"Reduce the number of dependencies","user":{"login":"brendanlong","id":1447206,"avatar_url":"https://avatars.githubusercontent.com/u/1447206?v=3","gravatar_id":"","url":"https://api.github.com/users/brendanlong","html_url":"https://github.com/brendanlong","followers_url":"https://api.github.com/users/brendanlong/followers","following_url":"https://api.github.com/users/brendanlong/following{/other_user}","gists_url":"https://api.github.com/users/brendanlong/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanlong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanlong/subscriptions","organizations_url":"https://api.github.com/users/brendanlong/orgs","repos_url":"https://api.github.com/users/brendanlong/repos","events_url":"https://api.github.com/users/brendanlong/events{/privacy}","received_events_url":"https://api.github.com/users/brendanlong/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-24T19:03:46Z","updated_at":"2016-03-25T20:35:14Z","closed_at":"2016-03-25T20:35:14Z","pull_request":{"url":"https://api.github.com/repos/substack/tape/pulls/276","html_url":"https://github.com/substack/tape/pull/276","diff_url":"https://github.com/substack/tape/pull/276.diff","patch_url":"https://github.com/substack/tape/pull/276.patch"},"body":"I was reading about overuse of tiny packages in Node.js and thought it would be fun to try to reduce the dependencies in tape. Pulling in Underscore.js and adding a util.js for `trim()` and `defined()` removes 10 dependencies, reduces the size of `node_modules` by 500 K, and reduces the install time (`npm install --prod`) by half. The \"string.prototype.trim\" package is the worst offender, pulling in 9 dependencies when MDN gives a one-liner to implement it. The other packages would be more complicated to remove (without \r\n\r\n`npm ls --prod` before:\r\n\r\n    tape@4.5.1 /Users/blong/workspace/tape\r\n    ├── deep-equal@1.0.1\r\n    ├── defined@1.0.0\r\n    ├── function-bind@1.1.0\r\n    ├─┬ glob@7.0.3\r\n    │ ├─┬ inflight@1.0.4\r\n    │ │ └── wrappy@1.0.1\r\n    │ ├─┬ minimatch@3.0.0\r\n    │ │ └─┬ brace-expansion@1.1.3\r\n    │ │   ├── balanced-match@0.3.0\r\n    │ │   └── concat-map@0.0.1\r\n    │ ├── once@1.3.3\r\n    │ └── path-is-absolute@1.0.0\r\n    ├── has@1.0.1\r\n    ├── inherits@2.0.1\r\n    ├── minimist@1.2.0\r\n    ├── object-inspect@1.1.0\r\n    ├── resolve@1.1.7\r\n    ├── resumer@0.0.0\r\n    ├─┬ string.prototype.trim@1.1.2\r\n    │ ├─┬ define-properties@1.1.2\r\n    │ │ ├── foreach@2.0.5\r\n    │ │ └── object-keys@1.0.9\r\n    │ └─┬ es-abstract@1.5.0\r\n    │   ├─┬ es-to-primitive@1.1.1\r\n    │   │ ├── is-date-object@1.0.1\r\n    │   │ └── is-symbol@1.0.1\r\n    │   ├── is-callable@1.1.3\r\n    │   └── is-regex@1.0.3\r\n    └── through@2.3.8\r\n\r\nAfter:\r\n\r\n    tape@4.5.1 /Users/blong/workspace/tape\r\n    ├── deep-equal@1.0.1\r\n    ├─┬ glob@7.0.3\r\n    │ ├─┬ inflight@1.0.4\r\n    │ │ └── wrappy@1.0.1\r\n    │ ├─┬ minimatch@3.0.0\r\n    │ │ └─┬ brace-expansion@1.1.3\r\n    │ │   ├── balanced-match@0.3.0\r\n    │ │   └── concat-map@0.0.1\r\n    │ ├── once@1.3.3\r\n    │ └── path-is-absolute@1.0.0\r\n    ├── inherits@2.0.1\r\n    ├── minimist@1.2.0\r\n    ├── object-inspect@1.1.0\r\n    ├── resolve@1.1.7\r\n    ├── resumer@0.0.0\r\n    ├── through@2.3.8\r\n    └── underscore@1.8.3"},"comment":{"url":"https://api.github.com/repos/substack/tape/issues/comments/201484896","html_url":"https://github.com/substack/tape/pull/276#issuecomment-201484896","issue_url":"https://api.github.com/repos/substack/tape/issues/276","id":201484896,"user":{"login":"brendanlong","id":1447206,"avatar_url":"https://avatars.githubusercontent.com/u/1447206?v=3","gravatar_id":"","url":"https://api.github.com/users/brendanlong","html_url":"https://github.com/brendanlong","followers_url":"https://api.github.com/users/brendanlong/followers","following_url":"https://api.github.com/users/brendanlong/following{/other_user}","gists_url":"https://api.github.com/users/brendanlong/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanlong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanlong/subscriptions","organizations_url":"https://api.github.com/users/brendanlong/orgs","repos_url":"https://api.github.com/users/brendanlong/repos","events_url":"https://api.github.com/users/brendanlong/events{/privacy}","received_events_url":"https://api.github.com/users/brendanlong/received_events","type":"User","site_admin":false},"created_at":"2016-03-25T20:35:14Z","updated_at":"2016-03-25T20:35:14Z","body":"Ah thanks, Lodash does look much nicer.\r\n\r\nThat's reasonable. I think tape is small enough that looking through dependencies was less useful than I was hoping. I would still have a preference for a bunch of lodash dependencies just for the single upstream and the fact that lodash doesn't depend on anything outside of itself, but it wouldn't make a huge difference."}}