Skip to content

kirill-zhirnov/commerceml-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is it?

A sax-style parser for CommerceMl (1C).

Install

npm install commerceml-js

How to use?

var fs = require('fs');
var commerceMl = require('commerceml-js');

var stream = commerceMl.createStream('import');

stream.on('commercialInfo', function(data) {
    console.log('commercialInfo:', data);
});

stream.on('classifier', function(data) {
    console.log('classifier', data);
});

stream.on('classifierGroup', function(data) {
    console.log('classifierGroup', data);
});

stream.on('classifierProperty', function(data) {
    console.log('classifierProperty', data);
});

stream.on('catalog', function(data) {
    console.log('catalog', data);
});

stream.on('product', function(data) {
    console.log('product', data);
});

stream.on('packageOffers', function(data) {
    console.log('packageOffers', data);
});

stream.on('offer', function(data) {
    console.log('offer', data);
});

stream.on("error", function(error) {
    console.log('error', error);
});

fs.createReadStream("./data/import.xml").pipe(stream);

Methods

createStream(<type>), where type can be:

  • "import" - if you are parsing import.xml file.

  • "offers" - if you are parsing offers.xml file.

About

A sax-style parser for CommerceMl (1C)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published