left-split
Split string capture group is captured to the left hand array item.
Capturing parenthesis return the separator as a distinct array element.
left-split
puts it at the end of the left hand array item.
Install
npm install left-split
Usage
leftsplit = 'foo bar'// => ['foo', ' ', 'bar'] // => ['foo ', 'bar'] 'foo\nbar\n'// => ['foo', '\n', 'bar', '\n', ''] // => ['foo\n', 'bar\n', '']