Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Parser/utils for AWS ARN:s.
This module provides a simple AWS ARN parser.
Note: v2.0.0 rewritten in TypeScript
npm install aws-arn
Then within the application do
import Arn from 'aws-arn';
https://henhal.github.io/aws-arn/
NOTE: V1 always returned
null
if attempting to parse invalid ARNs. V2 however supports passing a second argumentfail
with the valuetrue
to instead throw an error. This avoids having to deal with the return typeArn | null
, which simplifies TypeScript usage:const arn = Arn.parse('aws:arn:s3:eu-west-1:123456789:bucket/path/object'); // arn is of type Arn | null const arn = Arn.parse('aws:arn:s3:eu-west-1:123456789:bucket/path/object', false); // arn is of type Arn | null const arn = Arn.parse('aws:arn:s3:eu-west-1:123456789:bucket/path/object', true); // arn is of type Arn, or the call threw an error
const arn = Arn.parse('aws:arn:s3:eu-west-1:123456789:bucket/path/object', true);
console.log(arn);
> Arn {
scheme: 'aws',
partition: 'arn',
service: 's3',
region: 'eu-west-1',
accountId: '123456789',
resourcePart: 'bucket/path/object' }
Since the resource part of ARNs may have several formats, Arn objects also supply a read-only resource
property that returns a parsed representation of the resource part:
const arn = Arn.parse('aws:arn:s3:eu-west-1:123456789:bucket/path/object', true);
console.log(arn.resource);
> { type: 'bucket', id: 'path/object'}
const arn = Arn.parse('aws:arn:lambda:eu-west-1:123456789:Layer:my-layer:42', true);
console.log(arn.resource);
> { type: 'Layer', id: 'my-layer', qualifier: '42'}
const arn = new Arn({
service: 'lambda',
region: 'eu-west-1',
accountId: '123456789',
resourcePart: 'Layer:my-layer:42'
});
console.log(arn);
> Arn {
scheme: 'aws',
partition: 'arn',
service: 'lambda',
region: 'eu-west-1',
accountId: '123456789',
resourcePart: 'Layer:my-layer:42' }
const arn = Arn.parse('aws:arn:s3:eu-west-1:123456789:bucket/path/object', true);
console.log(arn.format());
> aws:arn:s3:eu-west-1:123456789:bucket/path/object
FAQs
AWS ARN parser/utils
We found that aws-arn demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.