<filename>Device (Javascript Node.js)/cli.js<gh_stars>0
var awsCli = require('aws-cli-js');
var Options = awsCli.Options;
var Aws = awsCli.Aws;

var options = new Options(
    /* accessKey    */ '<KEY>',
    /* secretKey    */ '<KEY>',
    /* sessionToken */ '<KEY>
    /* currentWorkingDirectory */ null
);

var aws = new Aws(options);

aws.command('iot list-things', function (err, data) {
    if (err) throw err
    console.log('data = ', data.raw);
});

  //data = {
  //  command: 'aws iam list-users ',
  //  raw: '{\\n    \\"Users\\": [\\n        {\\n            \\"UserName\\": \\"developer\\", \\n            \\"PasswordLastUsed\\": \\"2015-10-03T17:58:49Z\\", \\n            \\"CreateDate\\": \\"2015-06-03T07:37:25Z\\", \\n            \\"UserId\\": \\"AIDAJBXXXXXXXXXXXXXXXXX\\", \\n            \\"Path\\": \\"/\\", \\n            \\"Arn\\": \\"arn:aws:iam::03XXXXXXXXX:user/developer\\"\\n        }\\n    ]\\n}\\n',
  //  object:
  //   {
  //     Users:
  //      [{
  //        UserName: 'developer',
  //        PasswordLastUsed: '2015-10-03T17:58:49Z',
  //        CreateDate: '2015-06-03T07:37:25Z',
  //        UserId: 'AIDAJBXXXXXXXXXXXXXXXXX',
  //        Path: '/',
  //        Arn: 'arn:aws:iam::03XXXXXXXXX:user/developer'
  //      }]
  //   }
  //}