Neighbor's Preppy Maltese
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    aws-simple-requestpublic

    aws-simple-request


    npm install aws-simple-request

    Example Use:

    const awsApi = require('aws-simple-request');
     
    // assuming your credentials are passed in via process.env 
    let awsReq = new awsApi.awsRequest(process.env.secretKey, process.env.keyId, process.env.associateTag);
    // make the request 
    awsReq.makeRequest('webservices.amazon.de',  '/onca/xml', {
          "Operation": "ItemSearch",
          "SearchIndex": "Books",
          "Service":"AWSECommerceService",
          "Title": "Node.js"
        }, function (err, response, body) {
          if(err) throw err;
          console.log(body);
          done();
    });

    Documentation:

    Class: awsRequest


    awsRequest.constructor(secretKey, keyId, associateTag)

    Parameters

    • secretKey: string, aws secret access key. Should look like 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'
    • keyId: string, aws access key id. The Identifier for your Key. Should look like 'AKIAIOSFODNN7EXAMPLE'
    • associateTag: string, AssociateTag Parameter

    More Information: docs.aws.amazon.com


    awsRequest.makeRequest(endpoint, path, params, callback)

    Parameters

    • endpoint: string, amazon host. For Example: 'webservices.amazon.de'
    • path: string, For Example: '/onca/xml'
    • params: object, object which attributes should conform aws docs.
    • callback: function, function that get called with (error, response, body)

    More Information docs.aws.amazon.com


    Keywords

    none

    install

    npm i aws-simple-request

    Downloadsweekly downloads

    9

    version

    1.0.2

    license

    MIT

    last publish

    collaborators

    • avatar