s3-url-parser

1.0.3 • Public • Published

S3 URL PARSER

This library helps you extract the following information from S3 urls of any format:

  • bucket name
  • region
  • key

Formats:

Usage

import s3ParseUrl from 's3-url-parser';

const sampleUrl = 'http://my-bucket.s3.us-west-2.amazonaws.com/key-to-my-s3-object';
const { bucket, region, key } = s3ParseUrl(sampleUrl);

/*
  bucket = 'my-bucket'
  region = 'us-west-2'
  key = 'key-to-my-s3-object'
 */

Package Sidebar

Install

npm i s3-url-parser

Weekly Downloads

2,902

Version

1.0.3

License

MIT

Unpacked Size

10.1 kB

Total Files

5

Last publish

Collaborators

  • arecalde