This module allows to import stock information from CSV and XML files, with SFTP support.
$ npm install -g sphere-stock-import
# output help screen
$ stock-import
By default you need to specify the path to a local file in order to read the import information, via the --file
option.
When using SFTP, you should not use the --file
option, instead you need to provide at least the required --sftp*
options:
--sftpCredentials
(or--sftpHost
,--sftpUsername
,--sftpPassword
)--sftpSource
--sftpTarget
Column 1 will be used as SKU
identifier, whereas column 2 will be used as quantity
.
An example:
sku,quantity
foo,9
bar,-1
SKU-123,42
Please note that the header names are currently ignored.
<?xml version="1.0" encoding="UTF-8"?>
<root>
<row>
<code>foo</code>
<quantity>7</quantity>
</row>
<row>
<code>bar</code>
<quantity>1</quantity>
</row>
</root>
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt. More info here
Releasing a new version is completely automated using the Grunt task grunt release
.
grunt release // patch release
grunt release:minor // minor release
grunt release:major // major release
Copyright (c) 2014 SPHERE.IO Licensed under the MIT license.