4 ms·
> It would be great if there was a "single small file packages" movement so that more lean open source software will be created. There are certainly npm author
by danielsamuels 5y ago
> It would be great if there was a "single small file packages" movement so that more lean open source software will be created.
There are certainly npm authors doing this already, feross[1] is a good example. That means you get packages like is-buffer[2].
[1]: https://www.npmjs.com/~feross https://www.npmjs.com/~feross
[2]: https://github.com/feross/is-buffer/blob/master/index.js https://github.com/feross/is-buffer/blob/master/index.js
- TekMol 5y agoWhat I would do if I wanted to use "is-buffer" is I would copy this index.js to a new file called "isBuffer.js" and it would look like this: export function isBuffer (obj) { return obj != null && obj.constructor != null && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) } Imho, there is no need to pull 10 files into my project to use one function.
- danielsamuels 5y agoYou would, of course, preserve the copyright and license notices too. Otherwise that would be a violation of the license.
- TekMol 5y agoYes, in this case I would put something like this on top of the file: # Fork by TekMol of https://github.com/feross/is-buffer # Which is MIT licensed by Feross Aboukhadijeh I am actually never completely sure how to properly do this. Would the next forker write the following then? # Fork by Joe of https://github.com/tekmol/isBuffer # Which is a fork by TekMol of https://github.com/feross/is-buffer # Which is MIT licensed by Feross Aboukhadijeh
- rlpb 5y agoLooking at that function, I'm not convinced that it's copyrightable in the first place. Once you know what it's supposed to do, how else would you express it? Of course it's only appropriate to credit the author anyway, and one way to do that nicely is by following the license requirements. I just think "violation of the license" is a bit of an unnecessarily strong statement, given the triviality and the likely non-copyrightability of the code. Your lawyer's opinion may vary.