Skip to content

Commit

Permalink
feat: add a binary to convert mpd to m3u8 json in node (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey authored Mar 26, 2021
1 parent 8b58b39 commit 608aa9d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bin/parse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env node
/* eslint-disable no-console */
const fs = require('fs');
const path = require('path');
const {parse} = require('../dist/mpd-parser.cjs.js');

const file = path.resolve(process.cwd(), process.argv[2]);
const result = parse(fs.readFileSync(file, 'utf8'), {
manifestUri: ''
});

console.log(JSON.stringify(result, null, 2));
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"type": "git",
"url": "git@github.com:videojs/mpd-parser.git"
},
"bin": {
"mpd-to-m3u8-json": "bin/parse.js"
},
"scripts": {
"prenetlify": "npm run build",
"netlify": "node scripts/netlify.js",
Expand Down

0 comments on commit 608aa9d

Please sign in to comment.