
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
This is command line interface tool to perform some conversion operation given in a config file on any given csv file and will write the converted csv file to the given output location
This is command line interface tool to perform some conversion operation given in a config file on any given csv file and will write the converted csv file to the given output location
CSVHelper uses a number of open source projects to work properly:
And of course CSVHelper itself is open source with a public repository on GitHub.
CSVHelper requires Node.js v10+ to run.
Install
npm install -g csvhelper
Usage from any where in the cmd execute below commands with mentioned args
csvhelper -s <sourceCSVpath> -c <configJSONfilePath> -o <outputFilePath>
below is the total JSON config options, based on the operations concerned options should be provided to perform the transformation
{
"operation": "",
// allowed operation values
// formatter , filter, merge, formulaField
"predicateOptions": {
"columnName" : "mention column name base on which predicate should perform",
"value": "threshold value",
"operator": "operator for comparison"
},
// predicateOptions is required when the operation is filter
"formateOptions": {
"columnName": "column name on which formating should happen currently supports date column type",
"formate" : "formate option ex MMM d, YYYY"
},
// formateOptions is required when the operation is formatter
"mergeOptions": {
"newColumnName": "new column name",
"mergeColumns": ["array of column names in string"], ex ["col1", "col2"]
"formate": "string inpeterpolation order based on which columns should be merged ex: ${0}, ${1} will give col1, col2"
}
// mergeOptions is required when the operation is merge
"formulaFieldOptions" : {
"columnName": "new column name",
"predicate": {
"field":"field on which predicate should be performed",
"value": "threshold value",
"operator": "comparison operator",
"truthyValue":"what value should be added to column if predicate is true",
"falsyValue": "what value should be added to column if predicate is fals"
}
}
//formulaFieldOptions is required when the operation is formulaField
}
for formatter operation
{
"operation" : "formatter",
"formateOptions" : {
"columnName" : "dob",
"formate": "MMM d, YYYY"
}
}
filter operation config
{
"operation" : "filter",
"predicateOptions" : [{
"columnName": "age",
"value": "50",
"operator": ">"
}]
}
Merge operation config
{
"operation" : "merge",
"mergeOptions": {
"newColumnName": "name",
"mergeColumns": ["first_name","last_name"],
"formate": "${0}, ${1}"
}
}
Formula field config
{
"operation" : "formulaField",
"formulaFieldOptions": {
"columnName": "eligible_for_voting",
"predicate": {
"field":"age",
"value": "18",
"operator": ">",
"truthyValue":"T",
"falsyValue": "F"
}
}
}
MIT
Free Software, Hell Yeah!
FAQs
This is command line interface tool to perform some conversion operation given in a config file on any given csv file and will write the converted csv file to the given output location
The npm package csvhelper receives a total of 3 weekly downloads. As such, csvhelper popularity was classified as not popular.
We found that csvhelper 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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.