Skip to content

Commit

Permalink
ignore: update instructions for ES6 (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
forbesjo authored Mar 21, 2018
1 parent d4403e3 commit 4c16d7e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,14 @@ const manifest = [

const parser = new m3u8Parser.Parser();
parser.addParser({
expression: /#VOD-TIMING/,
expression: /#VOD-TIMING/,
customType: 'vodTiming',
segment: true
});

parser.push(manifest);
parser.end();
parser.manifest.segments[0].custom.vodTiming // #VOD-TIMING:1511816599485
parser.manifest.segments[0].custom.vodTiming // #VOD-TIMING:1511816599485
```
## Including the Parser

Expand All @@ -335,6 +335,13 @@ var m3u8Parser = require('m3u8-parser');
var parser = new m3u8Parser.Parser();
```

With ES6:
```js
import { Parser } from 'm3u8-parser';

const parser = new Parser();
```

### RequireJS/AMD

When using with RequireJS (or another AMD library), get the script in whatever way you prefer and `require` the parser as you normally would:
Expand Down

0 comments on commit 4c16d7e

Please sign in to comment.