Socket
Socket
Sign inDemoInstall

@architect/utils

Package Overview
Dependencies
Maintainers
5
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@architect/utils

Common utility functions


Version published
Weekly downloads
5K
increased by23.77%
Maintainers
5
Weekly downloads
 
Created
Source

@architect/utils GitHub CI status

@architect/utils are common utilities for the @architect suite of projects.

Installation

npm i @architect/utils

API

utils.banner(params)

Responsible for printing the standard banner, and loading the basic environment variables and necessary AWS credentials necessary to run Architect.

params are required with the following available properties:

  • inventory (required): Inventory object from @architect/inventory
  • disableBanner: run Architect's environment bootstrapping routines, but don't display the actual banner
  • disableRegion: don't print the AWS region
  • disableProfile: don't print the AWS profile
  • version: the package version string to print out (e.g. Architect 1.2.3)

utils.getLambdaName(fn)

Returns a valid AWS Lambda function name based on its URL (route).

utils.pathToUnix(pathString)

Converts any path to a Unix style path, with / as the seperator. This works around Windows issues where / is assumed across other parts of Architect.

utils.toLogicalID(str)

Converts str into PascalCase for CloudFormation use.

utils.updater(name, params)

name (a string) is required; params may include the boolean option quiet to manually override Architect's global printing status.

Returns a function to be reused for standardized logging updates with the following methods:

  • status - prints an affirmative status update
    • optional: arbitrary number of supporting info on new lines with each additional param
  • start - starts an animated progress indicator
    • aliases: update
  • done - ends current progress indicator with an update
    • aliases: stop
  • cancel - cancels current progress indicator without an update
  • err - pretty prints an error
    • aliases: error and fail
  • warn - cancels current progress indicator and prints a warning
    • aliases: warn
  • raw - just logs a message as-is (while respecting quiet)

Automatically respects Architect's global printing status, and also respects the following env vars:

  • ARC_QUIET - if truthy, disables printing
  • CI - if truthy, disables certain terminal progress animations

FAQs

Package last updated on 22 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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