Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@commercetools/csv-parser-orders
Advanced tools
Convert commercetools orders CSV data to JSON
This module is update actions based. Update actions currently supported is:
npm install @commercetools/csv-parser-orders -g
Usage: csvparserorders [options]
Convert commercetools orders CSV data to JSON.
Options:
--help, -h Show help text. [boolean]
--version, -v Show version number. [boolean]
--type, -t Predefined type of csv
[required] [choices: "lineitemstate", "returninfo"]
--inputFile, -i Path to CSV file. [default: "stdin"]
--outputFile, -o Input CSV file. [default: "stdout"]
--batchSize, -b Number of CSV rows to handle simultaneously. [default: 100]
--delimiter, -d Used CSV delimiter. [default: ","]
--strictMode, -s Parse CSV strictly. [default: true]
--projectKey, -p API project key. [required]
--host HTTP client host parameter.
--protocol HTTP client protocol parameter.
--accessToken HTTP client access token.
--logLevel Logging level: error, warn, info or verbose.
[default: "info"]
When running with --outputFile
set, logging information is shown directly otherwise it goes to csvparserorders.log
with the exception of fatal errors.
You can also use this tool as a required module
import { LineItemStateCsvParser } from '@commercetools/csv-parser-orders'
import fs from 'fs'
const apiCredentials = {
project_key: process.env.CM_PROJECT_KEY,
client_id: '*********',
client_secret: '*********'
};
const lineitemstate = new LineItemStateCsvParser(
{
config: apiCredentials,
access_token: <access_token>,
},
{
error: console.error,
warn: console.warn,
info: console.log,
verbose: console.log,
},
{
strictMode: true
}
)
lineItemState.parse(
fs.createReadStream('./input.csv'),
fs.createWriteStream('./output.json')
);
Errors on the level error
come from events that are fatal and thus stop the stream of data
Data is exported in JSON in this format
[{
"orderNumber": "234",
"lineItems": [{
"state": [{
"quantity": 10,
"fromState": "processing",
"toState": "shipped"
}]
}]
}]
CsvParserOrders
main methods accepts three objects as arguments:
batchSize
: number of CSV rows to handle simultaneously. (default: 100
)delimiter
: the used CSV delimiter (default: ,
)strictMode
: whether to parse the CSV strictly (default: true
)See CONTRIBUTING.md for info on contributing to eslint-config
FAQs
Converts commercetools order data from CSV to JSON.
The npm package @commercetools/csv-parser-orders receives a total of 1 weekly downloads. As such, @commercetools/csv-parser-orders popularity was classified as not popular.
We found that @commercetools/csv-parser-orders demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 15 open source maintainers 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.