ryanve / eol

JavaScript newline character converter

Home Page:https://www.npmjs.com/package/eol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Split functions into modules

NicoBurno opened this issue · comments

commented

Most often, only some of the functions in the library are used...

Can we divide the eol.js into separate modules?
Then we can only use the functions we need here like this:

import split from 'eol/split';

Backward compatibility will be, if we leave the assembled version of the entry point.

What would be the benefits? Would they warrant the excess tooling? It's only 41 lines and the methods share variables in the closure. Most usage of eol appears to be on the server. Also I think that there is a readability benefit to importing the whole library. I mean like eol.split seems more expressive than just split for example.