New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aws-cli-js

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-cli-js - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

6

lib/index.js

@@ -37,4 +37,6 @@ /**

if (!callback) {
callback = options;
options = null;
if (typeof options === 'function') {
callback = options;
options = null;
}
}

@@ -41,0 +43,0 @@

{
"name": "aws-cli-js",
"version": "0.0.2",
"version": "0.0.3",
"description": "A node.js wrapper for the aws command line interface",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -29,3 +29,3 @@ # aws-cli-js

var awsCli = new AwsCli({
aws_access_key_id: 'PUTVALUEHERE',
aws_access_key_id: 'PUTVALUEHERE',
aws_secret_access_key: 'abcdefPUTVALUEHERE',

@@ -40,3 +40,3 @@ });

// 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\\": \\"AIDAJB73CFKOYE2FBGGM2\\", \\n \\"Path\\": \\"/\\", \\n \\"Arn\\": \\"arn:aws:iam::031641171132:user/developer\\"\\n }\\n ]\\n}\\n",""]',
// 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:

@@ -68,3 +68,3 @@ // {

// 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\\": \\"AIDAJB73CFKOYE2FBGGM2\\", \\n \\"Path\\": \\"/\\", \\n \\"Arn\\": \\"arn:aws:iam::031641171132:user/developer\\"\\n }\\n ]\\n}\\n",""]',
// 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:

@@ -86,9 +86,26 @@ // {

* ??
* describe-instances
```js
awsCli.command('??').then(function (data) {
awsCli.command('ec2 describe-instances --instance-ids i-789b3ba7').then(function (data) {
console.log('data = ', data);
});
//data = { command: 'aws ec2 describe-instances --instance-ids i-789b3ba7 ',
// raw: '["{\\n \\"Reservations\\": [\\n {\\n \\"OwnerId\\": \\"031641171132\\", \\n \\"ReservationId\\": \\"r-a48ad878\\", \\n \\"Groups\\": [], \\n \\"Instances\\": [\\n {\\n
// \\"Monitoring\\": {\\n \\"State\\": \\"disabled\\"\\n }, \\n
// \\"PublicDnsName\\": \\"ec2-52-64-166-221.ap-southeast-2.compute.amazonaws.com\\", \\n \\"State\\": {\\n
// ...
```
or with options
```js
awsCli.command('ec2 describe-instances', , { 'instance-ids': instance_id }).then(function (data) {
console.log('data = ', data);
});
//data = { command: 'aws ?? ',

@@ -98,1 +115,2 @@

@@ -27,13 +27,84 @@ /**

describe('AwsCli', function () {
//describe('AwsCli run without modifications', function () {
it('should merge opts', function () {
var awsCli = new AwsCli({ a: 'a' });
assert.isNotNull(awsCli);
assert.equal(awsCli.a, 'a');
//console.log('awsCli', awsCli);
});
// it('should merge opts', function () {
// var awsCli = new AwsCli({ a: 'a' });
// assert.isNotNull(awsCli);
// assert.equal(awsCli.a, 'a');
// //console.log('awsCli', awsCli);
// });
it('command iam list-users should pass', function (done) {
// it('command iam list-users should pass', function (done) {
// this.timeout(1 * 60 * 1000);//1 minute
// var awsCli = new AwsCli({
// aws_access_key_id: config.aws.accessKeyId,
// aws_secret_access_key: config.aws.secretAccessKey
// //cwd: 'path to current working directory'
// });
// assert.isNotNull(awsCli);
// var failed = false;
// var err = null;
// awsCli.command('iam list-users').then(function (data) {
// //console.log('data = ', util.inspect(data, {depth: 10}));
// assert.isNotNull(data);
// }).finally(function () {
// //console.log('finally ');
// assert.isFalse(failed);
// assert.isNull(err);
// done();
// });
// });
// it('command iam list-users should pass with callback', function (done) {
// this.timeout(1 * 60 * 1000);//1 minute
// var awsCli = new AwsCli({
// aws_access_key_id: config.aws.accessKeyId,
// aws_secret_access_key: config.aws.secretAccessKey
// //cwd: 'path to current working directory'
// });
// assert.isNotNull(awsCli);
// var failed = false;
// var err = null;
// awsCli.command('iam list-users', function (err, data) {
// //console.log('data = ', util.inspect(data, { depth: 10 }));
// assert.isNotNull(data);
// done();
// });
// });
// it('command aim2 should fail', function (done) {
// var awsCli = new AwsCli();
// assert.isNotNull(awsCli);
// var failed = false;
// var err = null;
// awsCli.command('iam2 list-users').then(function (data) {
// //console.log('data = ', data);
// assert.isNotNull(data);
// }).catch(function (error) {
// assert.isNotNull(error);
// err = error;
// failed = true;
// //console.log('error = ', error);
// }).finally(function () {
// //console.log('finally ');
// assert.isTrue(failed);
// assert.isNotNull(err);
// done();
// });
// });
//});
describe('AwsCli change ids', function () {
var instance_id = 'i-789b3ba7';
it('ec2 describe-instances', function (done) {
this.timeout(1 * 60 * 1000);//1 minute

@@ -50,3 +121,3 @@

var err = null;
awsCli.command('iam list-users').then(function (data) {
awsCli.command('ec2 describe-instances --instance-ids ' + instance_id).then(function (data) {
//console.log('data = ', util.inspect(data, {depth: 10}));

@@ -62,3 +133,3 @@ assert.isNotNull(data);

it('command iam list-users should pass with callback', function (done) {
it('ec2 describe-instances with options', function (done) {
this.timeout(1 * 60 * 1000);//1 minute

@@ -75,26 +146,9 @@

var err = null;
awsCli.command('iam list-users', function (err, data) {
awsCli.command('ec2 describe-instances', { 'instance-ids': instance_id }).then(function (data) {
//console.log('data = ', util.inspect(data, { depth: 10 }));
assert.isNotNull(data);
done();
});
});
it('command aim2 should fail', function (done) {
var awsCli = new AwsCli();
assert.isNotNull(awsCli);
var failed = false;
var err = null;
awsCli.command('iam2 list-users').then(function (data) {
//console.log('data = ', data);
assert.isNotNull(data);
}).catch(function (error) {
assert.isNotNull(error);
err = error;
failed = true;
//console.log('error = ', error);
}).finally(function () {
//console.log('finally ');
assert.isTrue(failed);
assert.isNotNull(err);
assert.isFalse(failed);
assert.isNull(err);
done();

@@ -105,7 +159,1 @@ });

});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc