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

@infrascan/cli

v0.5.0

Published

Thin command line wrapper around the infrascan sdk

Downloads

3

Readme

@infrascan/cli

The Infrascan CLI is a thin wrapper around the Infrascan SDK which outputs its state to the local file system.

The Infrascan CLI exposes two commands: scan and graph. A scan will read in all of the information that it can from your AWS account, and write it to your local file system. You can then run the graph command to take that scan output and convert it into an infrastructure diagram.

Prerequisite

Infrascan requires read access to your AWS account to generate its graphs. Read access can be given by specifying a profile in your AWS credentials file, or by using the default credential provider chain and providing a role to assume.

Quickstart

Scan

To run a scan command, we first need to create the config file. The config file will tell the CLI which regions to scan, and how to authenticate with AWS. The config file format is:

[
  {
    "regions": ["eu-west-1", "us-east-1"],
    "profile": "infrascan-read-access-staging"
  },
  {
    "regions": ["eu-west-1"],
    "roleToAssume": "arn:aws:iam::000000000000:role/InfrascanReadOnlyRolePreProd"
  }
]

The scan command takes our config file and an output directory as arguments. The output directory is where all of the state generated during the scan will be written. This will be used by our graph command to produce an infrastructure diagram.

infrascan scan -c config.json -o ./state

The state directory should contain JSON files in the format of: <AccountID>-<Region>-<Service>-<FunctionCalled>.json.

Graph

To convert the scan output into a graph, we run the graph command passing the scan output directory as our input:

infrascan graph --input ./state

The graph output will be saved to a graph.json file in the state directory. The graph file contains an array of JSON objects representing the Nodes and Edges of the graph. This is formatted to be used with cytoscape, however it can be translated into any graphing library (Note: the graphs usually require on being able to create parent-child relationships)

You can view your graph by pasting the contents of your graph.json file into: render.infrascan.io.