npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

angular-aws

v1.1.0

Published

Angular AWS login and services integration

Readme

angular-aws

Angular AWS login and services integration

Install

Include require files

<script src="dist/angular-aws-lib.js"></script>
<script src="dist/angular-aws.min.js"></script>

Load module in your angular app

var yourApp = angular.module('yourApp', ['angular-aws']);

Configure

configure $AWSProvider in your app.config

yourApp.config(function($AWSProvider) {

	$AWSProvider.setRegion('us-east-1');
	$AWSProvider.poolData = {
	    UserPoolId : '', // your user pool id here
	    ClientId : '' // your client id here
	};
	$AWSProvider.cognitoLoginId = ''; // your cognito login id here
	$AWSProvider.identityPoolId = ''; //go to AWS Cognito Federated Identites
	$AWSProvider.userAttributes = ['email', 'phone_number' ]; //the standard attributes you require in AWS Cognito
	$AWSProvider.SESSource = ''; //email from
	$AWSProvider.MFARequired = false; //do you require your clients to use MFA?

});

Services

Cognito

$scope.initCognito = function(){
    Cognito.initialize($scope.user, $scope.pass, [{Name:"email", Value:$scope.email},{Name:"phone_number",Value:$scope.tel}]);
};

$scope.register = function(){
    Cognito.register($scope.user,$scope.pass,[{Name:"email", Value:$scope.email},{Name:"phone_number",Value:$scope.tel}],
        function(success,data){
            if(success) console.log(data);
            else console.error(data);
        }
    );
};

$scope.authenticate = function(){
    Cognito.authenticate($scope.user, $scope.pass,
        function(success,data){
            if(success){
                console.log(data);
            }else{
                console.error(data);
            }
    });
};

$scope.attributes = function(e){
    Cognito.getUserAttributes(function(success,data){
        console.log(data);
    });
};

$scope.exit = function(e){
    Cognito.signOut();
}
$scope.read = function(e){
    Cognito.getSession();
}

DynamoDB

$scope.read = function(){
    var readparams = {
      Key: {
        id: {S: 'f95217c0-8ca8-11e6-9bff-b3956a3b4954'}
      },
      AttributesToGet: ['name'],
      TableName: 'testtable'
    };
    DynamoDB.read(readparams, function(success,data){
        if(success) console.log(data);
        else console.error(data);
    });
}

$scope.write = function(){
    var data = {
        "id": DynamoDB.getguid(),
        "name":$scope.name,
        "year":$scope.year,
        "value":$scope.value,
        "values":$scope.values,
        "data": new Date().toLocaleString()
    }
    DynamoDB.write("testtable", data, function(success,data){
        if(success) console.log(data);
        else console.error(data);
    });
}

$scope.find = function(){

    var params = {
        TableName : "testtable",
        ProjectionExpression: "#yr,#id,#name,#value",
        FilterExpression: "#yr = :yyyy",
        ExpressionAttributeNames: {
            "#yr": "year",
            "#id": "id",
            "#name": "name",
            "#value": "value"
        },
        ExpressionAttributeValues: {
             ":yyyy": "2015"
        }
    };

    function onScan(err, data) {
        if (err) {
                console.error("Unable to query" + err);
        } else {
                console.log("Query succeeded.");
                console.log(data);
                if (typeof data.LastEvaluatedKey != "undefined") {
                        console.log("Scanning for more...");
                        params.ExclusiveStartKey = data.LastEvaluatedKey;
                        DynamoDB.scan(params, onScan);
                }
        }
    }

    DynamoDB.scan(params, onScan);
}

S3

$scope.upload = function(e){
    var fileChooser = document.getElementById('file-chooser');
    var button = document.getElementById('upload-button');
    var results = document.getElementById('results');

    var file = fileChooser.files[0];

    if (file) {
        results.innerHTML = '';
        var filename = file.name;

        S3.upload('test-bucket', filename, file, function(status){
            results.innerHTML = !status ? 'ERROR!' : 'UPLOADED.';
        });

    } else {
      results.innerHTML = 'Nothing to upload.';
    }
}

SES

$scope.emailrecipe = "";
$scope.sendEmail = function(){
	var object = "test";
	var msg = "test message";
	SES.sendEmail($scope.emailrecipe, object, msg, function(status, data){
		if(!status) console.error(data);
	})
}

Lambda

$scope.functionName = "";
$scope.execFunction = function(){
	Lambda.invoke($scope.functionName, function(status, data){
		if(!status) console.error(data);
		else console.log(data);
	}, {test: "testone", test2: "testtwo"})
}