
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@architect/utils
Advanced tools
@architect/utils
@architect/utils are common utilities for the @architect suite of projects.
npm i @architect/utils
utils.banner(params)
Reads a project's the Architect manifest and prints out: app name, AWS region, AWS profile, version, and current working directory, in addition to loading basic environment variables and necessary AWS credentials.
params
is an object which can provide the following properties to customize this behaviour:
disableRegion
: don't print the AWS regiondisableProfile
: don't print the AWS profileversion
: the version to print oututils.getLambdaName(fn)
Returns a valid AWS Lambda function name based on its URL (route).
utils.getLayers(arc)
Returns Lambda layers defined in an Architect project manifest. arc
is an object returned by the @architect/parser
, parsed from an Architect project manifest file.
utils.getRuntime(arc)
Returns the Lambda runtime defined in an Architect project manifest. arc
is an object returned by the @architect/parser
, parsed from an Architect project manifest file.
utils.getRuntime.allowed(runtime)
Takes a runtime
string and returns the same string if it' iss' a runtime allowed in Architect. Otherwise, returns a default runtime which Architect will use (currently nodejs10.x
).
utils.initEnv(callback)
Populates the runtime environment with variables from a .arc-env
if present. Details about this functionality can be found in the @architect/env project (pending resolution of architect/env#2).
utils.inventory(arc)
Returns an object containing:
restapis
, websocketapis
, lambdas
,
types
, iamroles
, snstopics
, sqstopics
, s3buckets
, cwerules
and
tables
localPaths
mapping inventory code (where applicable) to paths on
the local filesystemThe returned object is based on the provided arc
, which is an object returned by the @architect/parser
, parsed from an Architect project manifest file. (If no arc
object is passed, it will attempt to parse one itself.)
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.portInUse(port, callback)
Tests that the port specified by port
is available to be used. If an error is raised attempting to listen on the specified port, callback
will be invoked with an error argument. If it is available, callback
will be invoked with no arguments.
utils.readArc(params={})
Returns an object containing the following properties:
raw
: the raw string contents of the arc project filearc
: the parsed (via @architect/parser) contents of the Architect project manifestThe project file is attempted to be parsed, in order, from .arc
, app.arc
, arc.yaml
, and arc.json
.
utils.toLogicalID(str)
Converts str
into PascalCase.
utils.validate(arc, raw, callback)
Validates a parsed arc file. Parameters to this function are:
arc
: an object returned by the @architect/parser
, parsed from an Architect project manifest fileraw
: the raw Architect project manifest file textcallback
: will be invoked with an error as its first argument if validation fails; otherwise will invoke passing null as the first argument and the parsed arc
object as the second argument[1.5.14] 2020-11-05
updater
errors now include stack tracesupdater
errors can no longer be quieted – errors are important!FAQs
Common utility functions
The npm package @architect/utils receives a total of 3,394 weekly downloads. As such, @architect/utils popularity was classified as popular.
We found that @architect/utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.