Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@music-metadata/s3

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@music-metadata/s3

Extension for music-metadata to read metadata from audio files on Amazon S3 storage

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
30
decreased by-42.31%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status NPM version npm downloads Known Vulnerabilities Total alerts Language grade: JavaScript

@music-metadata/s3

Extension for music-metadata to retrieve metadata from files stored on Amazon Web Services (AWS) S3 cloud storage.

The magic of this module is, it is able to extract the metadata from your audio files, without downloading and parsing the entire file. Using streaming-http-token-reader under the hood, it partial downloads the required chunks.

Installation

npm install @music-metadata/s3

Reading audio metadata from Amazon S3

Read metadata from 'My audio files/01 - My audio track.flac' stored in the S3 cloud:

const { MMS3Client } = require('@music-metadata/s3');
const S3 = require('aws-sdk/clients/s3');

(async () => {

  const s3 = new S3();
  const mmS3client = new MMS3Client(s3); // Pass S3 client to music-metadata-S3-client

  console.log('Parsing...');
  try {
    const data = await mmS3client.parseS3Object({
        Bucket: 'your-bucket',
        Key: 'My audio files/01 - My audio track.flac'
      }
    );
    console.log('metadata:', data);
  } catch (e) {
    console.error(`Oops: ${e.message}`);
  }
})();

Using conventional streaming using the disableChunked flag:

const { MMS3Client } = require('@music-metadata/s3');
const S3 = require('aws-sdk/clients/s3');

(async () => {

  const s3 = new S3();
  const mmS3client = new MMS3Client(s3); // Pass S3 client to music-metadata-S3-client

  console.log('Parsing...');
  try {
    const data = await mmS3client.parseS3Object({
        Bucket: 'your-bucket',
        Key: 'My audio files/01 - My audio track.flac'
      }, {
        disableChunked: true // Disable chunked transfer
      }
    );
    console.log('metadata:', data);
  } catch (e) {
    console.error(`Oops: ${e.message}`);
  }
})();

Options

optiontypedescription
disableChunkedbooleanset to true to switch to conventional sequential streaming.

Other options are inherited from music-metadata

Keywords

FAQs

Package last updated on 14 Nov 2019

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