joegesualdo / vtt-to-json

Convert WebVTT file to JSON
29 stars 5 forks source link

How do we parse a file? #2

Closed samprity closed 6 years ago

samprity commented 7 years ago

Current example usage

const vttToJson = require("vtt-to-json") 
let vttString = "..."; 
vttToJson(vttString)
.then((result) => {
  console.log(result)
});

How can we load a webvtt file instead of using strings?

joegesualdo commented 7 years ago

It doesn't support file paths at the current time. Instead, you could get/read the file contents and then pass them to the function.