npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@idrisakintobi/mec-mmc-maker

v1.0.3

Published

A modern TypeScript library for building MEC and MMC XML files for Amazon Prime

Downloads

13

Readme

MEC MMC XML Builder

A modern TypeScript library for building MEC (Media Entertainment Core) and MMC (Media Manifest Core) XML files for Amazon Prime Video according to MovieLabs specifications.

Features

JavaScript-Friendly: Clean object structures instead of CSV-like strings
Type-Safe: Full TypeScript support with comprehensive interfaces
Modern API: Builder pattern with intuitive methods
Well-Documented: JSDoc comments for all public APIs
Tested: Comprehensive test coverage
Standards-Compliant: Follows MovieLabs MEC v2.9 and MMC v1.9 specifications

Installation

npm install mec-mmc-maker

Quick Start

Building MEC XML

import { MECBuilder, MECData, WorkType, ReleaseType, NamespaceType } from 'mec-mmc-maker';

const mecData: MECData = {
    contentId: 'content123',
    localizedInfo: [
        {
            language: 'en-US',
            titleDisplay: 'Sample Movie',
            titleSort: 'Sample Movie',
            summary190: 'A short summary of the movie',
            summary400: 'A longer, more detailed summary of the movie content',
            artReference: [{
                reference: 'path/to/cover.jpg',
                resolution: '1920x1080',
                purpose: 'cover'
            }]
        }
    ],
    genre: [
        { primary: 'Action', subGenre: ['Adventure', 'Thriller'] }
    ],
    releaseYear: '2023',
    releaseDate: '2023-12-25',
    releaseHistory: [{
        type: ReleaseType.Theatrical,
        country: 'US',
        date: '2023-12-25'
    }],
    workType: WorkType.Movie,
    identifier: [{
        namespace: NamespaceType.EIDR,
        value: '10.5240/1234-5678-90AB-CDEF-GHIJ-K'
    }],
    cast: [{
        jobFunction: 'Actor',
        billingBlockOrder: '1',
        displayName: {
            'en-US': 'John Doe',
            'es-ES': 'Juan Pérez'
        }
    }],
    originalLanguage: 'en',
    organization: {
        id: 'org123',
        role: 'Producer'
    },
    companyDisplayCredit: {
        value: 'Sample Studios',
        language: 'en-US'
    }
};

const mecXml = MECBuilder.build(mecData);
console.log(mecXml); // <?xml version="1.0" encoding="UTF-8"?>...

Building MMC XML

import { MMCBuilder, MMCData, ExperienceType, ImagePurpose } from 'mec-mmc-maker';

const mmcData: MMCData = {
    audio: [{
        trackId: 'audio1',
        type: 'Primary',
        language: 'en',
        location: 'path/to/audio.mp4',
        hash: 'abc123'
    }],
    video: [{
        trackId: 'video1',
        type: 'Primary',
        language: 'en',
        location: 'path/to/video.mp4',
        hash: 'def456',
        picture: {
            heightPixels: '1080',
            widthPixels: '1920',
            aspectRatio: '16:9',
            progressive: true,
            progressiveScanOrder: 'Top'
        }
    }],
    presentation: [{
        id: 'pres1',
        trackNum: '1',
        videoId: 'video1',
        audioId: 'audio1'
    }],
    experience: [{
        id: 'exp1',
        type: ExperienceType.Movie,
        subType: 'Feature'
    }],
    alidExperience: [{
        alid: 'alid1',
        experienceId: 'exp1'
    }]
};

const mmcXml = MMCBuilder.build(mmcData);

XML Validation

import { validateXMLStructure } from 'mec-mmc-maker';

const isValid = validateXMLStructure(xmlString);
if (isValid) {
    console.log('XML is valid!');
}

API Documentation

All interfaces and methods include comprehensive JSDoc comments. Your IDE will provide full IntelliSense support.

Key Interfaces

  • MECData: Complete metadata structure for MEC XML
  • MMCData: Complete manifest structure for MMC XML
  • LocalizedInfo: Language-specific metadata
  • Genre: Genre classification (max 3 total)
  • CastMember: Cast and crew information

Builder Classes

  • MECBuilder.build(data: MECData): string: Generates MEC XML
  • MMCBuilder.build(data: MMCData): string: Generates MMC XML

Migration from mdmec-xml-maker

If you're migrating from the old mdmec-xml-maker library, see our Migration Guide for detailed instructions and examples.

Key Changes:

  • Object structures instead of semicolon-delimited strings
  • camelCase property names instead of PascalCase
  • Builder classes instead of function exports
  • Strong TypeScript types with full IntelliSense

Examples

See the test/sample-data directory for complete working examples.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Testing

npm test

License

MIT Licensed. See LICENSE file for details.

Related