Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

goods-exporter

Package Overview
Dependencies
Maintainers
0
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

goods-exporter - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

dist/package.json

19

dist/bundle.d.ts
import { Writable } from 'stream';
import { Category as Category$1 } from 'dist/bundle';

@@ -650,2 +651,15 @@ interface Product {

declare class WooCommerceFormatter implements FormatterAbstract {
formatterName: string;
fileExtension: Extension;
private readonly DEFAULT_COLUMNS;
private formatKeyAttribute;
private formatValueAttribute;
private formatProducts;
private createAttribute;
private extractAttributes;
private removeVisibleFromAttributes;
format(writableStream: Writable, products: Product[], categories?: Category[], _?: Brand[], __?: FormatterOptions): Promise<void>;
}
declare class YMLFormatter implements FormatterAbstract {

@@ -675,2 +689,3 @@ formatterName: string;

XMLFormatter: typeof XMLFormatter;
WooCommerceFormatter: typeof WooCommerceFormatter;
};

@@ -691,2 +706,4 @@

export { type Brand, type Category, Currency, type Exporter, Extension, FormatterAbstract, type FormatterOptions, Formatters, GoodsExporter, type IParam, type ISize, type Product, type Transformer, Vat };
declare const buildCategoryPaths: (categories: Category$1[]) => Map<number, Category$1[]>;
export { type Brand, type Category, Currency, type Exporter, Extension, FormatterAbstract, type FormatterOptions, Formatters, GoodsExporter, type IParam, type ISize, type Product, type Transformer, Vat, buildCategoryPaths };

4

package.json

@@ -14,3 +14,3 @@ {

"name": "goods-exporter",
"version": "1.1.3",
"version": "1.2.0",
"description": "A versatile JavaScript library for exporting goods data to various formats such as YML, CSV, and Excel. Simplify data export tasks with ease. Supports streams.",

@@ -29,2 +29,3 @@ "main": "./dist/cjs/index.cjs",

"build": "rollup -c",
"build:watch": "rollup -c --watch",
"test": "vitest",

@@ -44,2 +45,3 @@ "lint": "eslint --ext .ts --fix",

"insales",
"wocommerce",
"items",

@@ -46,0 +48,0 @@ "products",

@@ -8,3 +8,2 @@ # goods-exporter

A versatile JavaScript library for exporting goods data to various formats such as YML, CSV, and Excel. Simplify data

@@ -33,2 +32,3 @@ export tasks with ease.

- Tilda
- WooCommerce

@@ -48,10 +48,10 @@ ## Installation

```typescript
import { GoodsExporter, Product, Category, Formatters } from '../src';
import { GoodsExporter, Product, Category, Formatters } from "../src";
import { PassThrough } from "stream";
// Create an instance of the GoodsExporter class.
const exporter = new GoodsExporter()
const exporter = new GoodsExporter();
const products: Product[] = [] // Put your products;
const categories: Category[] = [{ id: 1, name: 'Обувь' }]
const products: Product[] = []; // Put your products;
const categories: Category[] = [{ id: 1, name: "Обувь" }];

@@ -80,18 +80,20 @@ // Call the data export method.

// Create an instance of the GoodsExporter class.
const exporter = new GoodsExporter()
const exporter = new GoodsExporter();
// Define an object 'transformers' that contains data transformation functions.
const transformers: Transformer[] = [
(products) => products.map(product => ({
...product,
price: product.price + 10000
(products) =>
products.map((product) => ({
...product,
price: product.price + 10000,
})),
(products) => products.map(product => ({
...product,
images: product.images?.map(image => image.replace("image", "pic"))
}))
]
(products) =>
products.map((product) => ({
...product,
images: product.images?.map((image) => image.replace("image", "pic")),
})),
];
// Set the formatter for exporting data to YML.
exporter.setFormatter(new Formatters.YMLFormatter()) // or your own Formatter;
exporter.setFormatter(new Formatters.YMLFormatter()); // or your own Formatter;

@@ -106,3 +108,4 @@ // Set transformers based on the specified keys.

# Supported by [PoizonAPI](https://t.me/PoizonAPI)
# Supported by [PoizonAPI](https://t.me/PoizonAPI)
[![PoizonAPI](https://i.ibb.co/HBbTpp0/Group-1.png)](https://t.me/PoizonAPI)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc