1.5.0 • Published 5 years ago

csv-injection-protector v1.5.0

Weekly downloads
117
License
MIT
Repository
github
Last release
5 years ago

csv-injection-protector

Why?

If you have any Input Field and that data goes to the Database in the backend and you generate CSV files with it, then you SHOULD think about CSV injection.

Probably, the string went to your DB is injected. They can execute any operation in the cell and also your CSV file can be corrupted and you can not open that.

It can be sanitized so that string is okay for the CSV.

How to use

Run

npm i csv-injection-protector

Then use in your code like below:

const riskyString = "=Risky string for CSV";
const sanitizedString = csvInjectionProtector(riskyString);
console.log(sanitizedString);
// "Risky string for CSV"

Contribution

git clone https://github.com/destromas1/csv-injection-protector.git

npm i

npm test

npm run build

Feel free to add more cases and PRs are welcome!

1.5.0

5 years ago

1.4.0

5 years ago

1.2.0

5 years ago

1.3.0

5 years ago

1.1.0

5 years ago

0.1.0

6 years ago