<commit_before># sphere-product-type-export

[![Travis][travis-badge]][travis-url]
[![Codecov][codecov-badge]][codecov-url]
[![npm][npm-lic-badge]][npm-lic-url]
[![semantic-release][semantic-release-badge]][semantic-release-url]
[![Commitizen friendly][commitizen-badge]][commitizen-url]
[![NPM version][npm-image]][npm-url]

A library that helps with exporting [product-types](http://dev.commercetools.com/http-api-projects-productTypes.html) from the [Commercetools Platform](http://www.commercetools.com/).  
This library is built to be used in conjunction with [sphere-node-cli](https://github.com/sphereio/sphere-node-cli).

## Features
- Export product types from your CTP project
- Creates 2 files - product type / attributes matrix and attributes list - that can be used to reimport product types

### Configuration
The configuration object may contain:
- `sphereClientConfig`: see the [sphere-node-sdk docs](http://sphereio.github.io/sphere-node-sdk/) for more information on this

## Usage with `sphere-node-cli`

You can use the product type export from the command line using the [`sphere-node-cli`](https://github.com/sphereio/sphere-node-cli).
Then you can export this file using the cli:
```
sphere-node-cli -t productTypeExport -p my-project-key
```
You can pass a custom configuration as described above via the `-c` operator followed by a JSON String that represents your configuration

## Direct usage

If you want more control, you can also use this library directly in JavaScript. To do this you first need to install it:
```
npm install sphere-product-type-export --save-dev
```
Then you can use it to export product types like so:
```
export ProductTypeExport from 'sphere-product-type-export'

const productType = {
  name: '<some-name>',
  description: '<some-description>'
}
const config = {
  sphereClientConfig: {
    config: {
      project_key: <PROJECT_KEY>,
      client_id: '*********',
      client_secret: '*********'<commit_msg>fix(readme): fix node cli example command<commit_after># sphere-product-type-export

[![Travis][travis-badge]][travis-url]
[![Codecov][codecov-badge]][codecov-url]
[![npm][npm-lic-badge]][npm-lic-url]
[![semantic-release][semantic-release-badge]][semantic-release-url]
[![Commitizen friendly][commitizen-badge]][commitizen-url]
[![NPM version][npm-image]][npm-url]

A library that helps with exporting [product-types](http://dev.commercetools.com/http-api-projects-productTypes.html) from the [Commercetools Platform](http://www.commercetools.com/).  
This library is built to be used in conjunction with [sphere-node-cli](https://github.com/sphereio/sphere-node-cli).

## Features
- Export product types from your CTP project
- Creates 2 files - product type / attributes matrix and attributes list - that can be used to reimport product types

### Configuration
The configuration object may contain:
- `sphereClientConfig`: see the [sphere-node-sdk docs](http://sphereio.github.io/sphere-node-sdk/) for more information on this

## Usage with `sphere-node-cli`

You can use the product type export from the command line using the [`sphere-node-cli`](https://github.com/sphereio/sphere-node-cli).
Then you can export this file using the cli:
```
sphere export -t productType -p my-project-key
```
You can pass a custom configuration as described above via the `-c` operator followed by a JSON String that represents your configuration

## Direct usage

If you want more control, you can also use this library directly in JavaScript. To do this you first need to install it:
```
npm install sphere-product-type-export --save-dev
```
Then you can use it to export product types like so:
```
export ProductTypeExport from 'sphere-product-type-export'

const productType = {
  name: '<some-name>',
  description: '<some-description>'
}
const config = {
  sphereClientConfig: {
    config: {
      project_key: <PROJECT_KEY>,
      client_id: '*********',
      client_secret: '*********'
{'fraction_non_alphanumeric': 0.1344984802431611, 'fraction_numerical': 0.0005065856129685917, 'mean_word_length': 4.764963503649635, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '693596', 'n_tokens_mistral': 1223, 'n_tokens_neox': 1172, 'n_words': 376}