As an addition to pull request #87 and advice of @longouyang againt globally requiring fs, this is a small edit, which directly requires fs, which fixes the problem with the if (fs.existsSync(fileName)) call (line 1050), where fs was previously not resolved (as there was no such symbol defined in the global scope).
Additionally, I fixed renaming logic in the case the file already exists, so e.g. no "....svg_213" will be created but "..._213.svg" as intended.
As an addition to pull request #87 and advice of @longouyang againt globally requiring fs, this is a small edit, which directly requires fs, which fixes the problem with the
if (fs.existsSync(fileName))
call (line 1050), where fs was previously not resolved (as there was no such symbol defined in the global scope). Additionally, I fixed renaming logic in the case the file already exists, so e.g. no "....svg_213" will be created but "..._213.svg" as intended.