This package, `subtitles-parser-vtt`, is a Node.js module designed to parse and convert SubRip (SRT) subtitle files. Despite having `vtt` in its name, it explicitly handles the SubRip (.srt) format for both parsing into a JavaScript object and converting an object back into SRT format. The current and only stable version is `0.1.0`, published in 2015. Given its age and lack of updates, the package is considered abandoned. It offers basic functionality to convert SRT timestamps to milliseconds, differentiating itself from more actively maintained, feature-rich subtitle parsers that often support multiple formats (like WebVTT), streaming APIs, and TypeScript typings.
npm install subtitles-parser-vttVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates parsing SubRip (SRT) content from a string, showing both string and millisecond timestamp outputs, and converting the parsed object back into SRT format using the `fromVtt` and `toVtt` methods.
Be aware that this package handles SRT. If you need WebVTT parsing, consider alternatives like `subtitle` or `srt-vtt-parser`.
For active development, consider using modern, maintained subtitle parsing libraries that support both SRT and VTT, such as `subtitle` (which has TypeScript support and a streaming API) or `@polyflix/vtt-parser` (for VTT specifically).
For ES Module projects, you can use dynamic `import()` or configure your build tools (like Webpack or Rollup) to handle CommonJS modules. Alternatively, migrate to a modern library with native ESM support.
Ensure you are calling the methods on the `parser` object: `const parser = require('subtitles-parser-vtt'); parser.fromVtt(srt);`Run `npm install subtitles-parser-vtt` to install the package.
Ensure your project is configured for CommonJS (`"type": "commonjs"` in package.json or no `type` field) or use `require` syntax. If you are in an ESM project, consider `import parser from 'subtitles-parser-vtt'` (which might still require a transpiler or be wrapped) or migrate to a native ESM subtitle parser.
No dependency data recorded yet.