Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 912 Bytes

File metadata and controls

29 lines (25 loc) · 912 Bytes

qs-amazon

Customed qs module for amazon query stringify

Check amazon querystring at Docs > Examples > Example query request > Show example code (click)

The qs module was proted from https://github.com/ljharb/qs

Usage

const qs = require('qs-amazon');
const assert = require('assert');

const str = qs.stringify(
    {
        ShipmentRequestDetails: {
            ItemList: {
                Item: [
                    {
                        OrderItemId: 26969160673646,
                        Quantity: 1,
                    },
                ],
            },
        },
    },
    { arrayFormat: 'amazon', encode: false, allowDots: true }
);
assert.equal(str, 'ShipmentRequestDetails.ItemList.Item.1.OrderItemId=26969160673646&ShipmentRequestDetails.ItemList.Item.1.Quantity=1');