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 🙏

© 2024 – Pkg Stats / Ryan Hefner

aws-sigv4-ec2meta

v1.0.2

Published

Signs an http(s) request options object with AWS Signature Version 4 headers and returns them

Downloads

3

Readme

aws-sigv4-ec2meta

Signs an http(s) request options object with AWS Signature Version 4 headers and returns them

Sample Usage

Use the signAWS function provided by the module to add the appropriate cryptographically secure headers to an http or https request options object. This function accepts an options object as the first parameter and a callback as the second parameter. checkout repo npm install

let signAWS = require('./aws-sigv4-ec2metadata/index.js');
let https = require('https');

let deleteOpts = {
    host: 'exampleapi.execute-api.us-west-2.amazonaws.com',
    path: '/api/configs/1',
    method: 'DELETE'
};

signAWS(deleteOpts, (signedOpts) => {
    let req = https.request(signedOpts, (res) => {
        let body = [];
        res.on('data', (d) => {
            body.push(d);
        });
        res.on('end', () => console.log(body.join('')));
    });
    req.on('error', console.error);
    req.end();
});

Testing Locally

To test locally, use the aws-mock-metadata library to simulate an ec2 instance profile environment.

Steps to Install on OSX

  1. Boto dependency
    1. sudo easy_install pip
    2. sudo pip install boto
  2. Clone https://github.com/dump247/aws-mock-metadata.git
  3. Configure aws-mock-metadata
    1. Create a server.conf file in the root of the aws-mock-metadata folder (see server.conf.sample for an example of this)
    2. Replace the **** values in this file with your AWS user access key and secret key
  4. Start the mock metadata server by running ./bin/server-macos
  5. Verify the server is running and configured correctly by hitting the metadata url in your local browser

Note that your user account and/or ec2 instance profile role must have the execute-api policy for a given resource in order to query AWS_IAM protected API methods.