Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
csv-utility
Advanced tools
A simple package to guess the separator and linebreak characters for a csv file.
A simple package to guess the separator and linebreak characters for a "csv" file.
npm install csv-utility
bower install csv-utility
var csvUtility = require('csv-utility');
var fs = require('fs');
var sample = fs.readFileSync('someFile.csv',{encoding:'utf8'});
var result = csvUtility.guessCSV(sample,{
linebreak: [';'],
sep: [':']
});
var result = csvUtility.guessCSV(sample,{
linebreak: [';'],
sep: [':']
});
sample
- a sample string of the raw csv (auto-cropped to 100kb)opts
(optional) - a configuration to specify additional possible separator or linebreak characters
linebreak
- the linebreak characters to use OR an array of possible linebreak characters (default: ["\r\n", "\r", "\n"])sep
- the separator character to use OR an array of possible separator characters (default: [",", "\t", "|", ";"])return
linebreak
- the most possible linebreak characterssep
- the most possible separator characterssample
- a sample string of the raw csv (auto-cropped to 100kb)opts
(optional) - an array of possible linebreak characters (default: ["\r\n", "\r", "\n"])return
- the most possible linebreak characterssample
- a sample string of the raw csv (auto-cropped to 100kb)linebreak
- the linebreak character to use (default: "\n")opts
(optional) - an array of possible separator characters (default: [",", "\t", "|", ";"])return
- the most possible separator characters1.0.0 Initial release 1.0.1 BUGFIX: Corrected the documentation for csvUtility.guessSeparator. 1.0.2 BUGFIX: Forgot to push the changes for the codes. 1.0.3 BUGFIX: Fixed bug at parsing non-array inputs.
FAQs
A simple package to guess the separator and linebreak characters for a csv file.
We found that csv-utility demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.