CSV Price Parser
Convert commercetools price CSV data to JSON. See example below for CSV format and sample response
Usage
npm install @commercetools/csv-parser-price --global
CLI
Usage: csvparserprice [options]
Convert commercetools price CSV data to JSON.
Options:
--help, -h Show help text. [boolean]
--version, -v Show version number. [boolean]
--inputFile, -i Path to input CSV file. [default: "stdin"]
--outputFile, -o Path to output JSON file. [default: "stdout"]
--apiUrl The host URL of the HTTP API service.
[default: "https://api.europe-west1.gcp.commercetools.com"]
--authUrl The host URL of the OAuth API service.
[default: "https://auth.europe-west1.gcp.commercetools.com"]
--batchSize, -b Number of CSV rows to handle simultaneously. [default: 100]
--delimiter, -d Used CSV delimiter. [default: ","]
--accessToken CTP client access token
--projectKey, -p API project key. [required]
--logLevel Logging level: error, warn, info or verbose.
[default: "info"]
--logFile Path to file where to save logs.
[default: "csvparserprice.log"]Note that when the stdout is used as an output stream all log messages are written by default to csvparserprice.log log file.
JS
Errors on the level error come from events that are fatal and thus stop the stream of data.
Configuration
CsvParserPrice accepts three objects as arguments:
API client credentials for the authentication middleware (required)
Logger takes object with four functions (optional)
Config (optional)
batchSize: number of CSV rows to handle simultaneously. (default:100)delimiter: the used CSV delimiter (default:,)
Sample CSV file
JSON object returned from the conversion of the CSV file above
Last updated