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

dash-parser

v0.0.1

Published

A simple library to read/write DASH manifests

Readme

DASH parser tests Coverage Status Known Vulnerabilities npm Downloads XO code style

dash-parser

A simple library to synchronously read/write MPEG-DASH manifests that conform to ISO/IEC 23009-1:2022

Install

NPM

Usage

import * as DASH from 'dash-parser';

// Parse an existing manifest file and create a MPD object
const mpdObject = DASH.parse(textData);

// Or create an object from scratch
const {MPD, BaseURL, Period, AdaptationSet} = DASH;
const mpdObject = new MPD({
  type: "static",
  minBufferTime: 2,
  profiles: 'urn:mpeg:dash:profile:isoff-on-demand:2011',
  mediaPresentationDuration: 512,
  children: [
    new BaseURL({
      url: "http://cdn1.example.com",
    }),
    new BaseURL({
      url: "http://cdn2.example.com",
    }),
    new Period({
      duration: 512,
      children: [
        new AdaptationSet({
          contentType: 'video',
          mimeType: 'video/mp4',
          codecs: 'avc1.4d401f',
          frameRate: 24,
          width: 1280,
          height: 720,
          children: [
            // ...
          ],
        }),
        new AdaptationSet({
          contentType: 'audio',
          mimeType: 'audio/mp4',
          codecs: 'mp4a.40.2',
          audioSamplingRate: 48000,
          children: [
            // ...
          ],
        }),
      ],
    },
  ],
});

// Convert the MPD object into a text
DASH.stringify(mpdObject);
/*
<?xml version="1.0" encoding="UTF-8"?>
  <MPD
    type="static"
    mediaPresentationDuration="PT512S"
    minBufferTime="PT2S"
    profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">
    
    <BaseURL>http://cdn1.example.com/</BaseURL>
    <BaseURL>http://cdn2.example.com/</BaseURL>
    
    <Period>
    ...
*/

API

DASH.parse(str)

Converts a plain text manifest into a structured MPD object

params

| Name | Type | Required | Default | Description | | ------- | ------ | -------- | ------- | ------------- | | str | string | Yes | N/A | A text data that conforms to ISO/IEC 23009-1 |

return value

| Type | Description | | ------ | ------------- | | MPD (See Data structure below.) | undefined | An object representing Media Presentation Description (or undefined in case of error) |

DASH.stringify(obj)

Converts an MPD object into a plain text manifest

params

| Name | Type | Required | Default | Description | | ------- | ------ | -------- | ------- | ------------- | | obj | MPD (See Data structure below.) | Yes | N/A | An object returned by DASH.parse() or a manually created MPD object |

return value

| Type | Description | | ------ | ------------- | | string | A text data that conforms to ISO/IEC 23010-1 (or undefined in case of error) |

DASH.setOptions(obj)

Updates the global option values

params

| Name | Type | Required | Default | Description | | ------- | ------ | -------- | ------- | ------------- | | obj | object | Yes | N/A | An object holding key/value pairs that will be merged with the internal option values. |

return value

| Type | Description | | ------ | ------------- | | void | N/A |

supported options

| Name | Type | Default | Description | | ---------- | ------- | ------- | ------------- | | strictMode | boolean | false | If true, the function throws an error when parse/stringify failed. If false, the function just logs the error and continues to run.| | silent | boolean | false | If true, console.error will be suppressed.|

DASH.getOptions()

Retrieves the current global option values

params

| Name | Type | Required | Default | Description | | ------- | ------ | -------- | ------- | ------------- | | N/A | void | N/A | N/A | Accepts no param |

return value

| Type | Description | | ------ | ------------- | | object | A cloned object containing the current option values |

Data structure

This section describes the structure of the object returned by parse() method.