
Research
Security News
Malicious npm Packages Target BSC and Ethereum to Drain Crypto Wallets
Socket uncovered four malicious npm packages that exfiltrate up to 85% of a victim’s Ethereum or BSC wallet using obfuscated JavaScript.
@plussub/srt-vtt-parser
Advanced tools
A dependency free SRT / Vtt subtitle parser, written in Typescript.
A dependency-free SRT/VTT subtitle parser, written in TypeScript.
npm i @plussub/srt-vtt-parser
import fs from 'fs';
import { parse } from '@plussub/srt-vtt-parser';
const { entries } = parse(
fs
.readFileSync('transcript.vtt') // or '.srt'
.toString()
);
entries.forEach(({ from, to, text, id }) => {
// process transcript entry
});
SRT (SubRip)
00:01:42,821 --> 00:01:44,289
(SIREN WAILING IN DISTANCE)
multiline test
2
00:01:45,365 --> 00:01:48,084
<i>DRIVER: There's 100,000 streets in this city.</i>
3
00:01:49,077 --> 00:01:51,421
You don't need to know the route.
VTT
WEBVTT
1
00:01:42.821 --> 00:01:44.289
(SIREN WAILING IN DISTANCE)
multiline test
2
00:01:45.365 --> 00:01:48.084
<i>DRIVER: There's 100,000 streets in this city.</i>
3
00:01:49.077 --> 00:01:51.421
You don't need to know the route.
Results into
{
"entries": [
{
"from": 102821,
"id": "1",
"text": "(SIREN WAILING IN DISTANCE)\nmultiline test",
"to": 104289
},
{
"from": 105365,
"id": "2",
"text": "<i>DRIVER: There's 100,000 streets in this city.</i>",
"to": 108084
},
{
"from": 109077,
"id": "3",
"text": "You don't need to know the route.",
"to": 111421
}
]
}
Respect NOTE/ MULTILINE NOTE / STYLE Blocks and inline style but will ignore them for the output.
WEBVTT
STYLE
::cue {
background-image: linear-gradient(to bottom, dimgray, lightgray);
color: papayawhip;
}
/* Style blocks cannot use blank lines nor "dash dash greater than" */
NOTE comment blocks can be used between style blocks.
00:01:42.821 --> 00:01:44.289
(SIREN WAILING IN DISTANCE)
multiline test
NOTE style blocks cannot appear after the first cue.
this is a multiline note block
some identifier
00:01:45.365 --> 00:01:48.084
<i>DRIVER: There's 100,000 streets in this city.</i>
00:01:49.077 --> 00:01:51.421
You don't need to know the route.
Results into
{
"entries": [
{
"from": 102821,
"id": "",
"text": "(SIREN WAILING IN DISTANCE)\nmultiline test",
"to": 104289
},
{
"from": 105365,
"id": "some identifier",
"text": "<i>DRIVER: There's 100,000 streets in this city.</i>",
"to": 108084
},
{
"from": 109077,
"id": "",
"text": "You don't need to know the route.",
"to": 111421
}
]
}
FAQs
A dependency free SRT / Vtt subtitle parser, written in Typescript.
The npm package @plussub/srt-vtt-parser receives a total of 6,122 weekly downloads. As such, @plussub/srt-vtt-parser popularity was classified as popular.
We found that @plussub/srt-vtt-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket uncovered four malicious npm packages that exfiltrate up to 85% of a victim’s Ethereum or BSC wallet using obfuscated JavaScript.
Security News
TC39 advances 9 JavaScript proposals, including Array.fromAsync, Error.isError, and Explicit Resource Management, which are now headed into the ECMAScript spec.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.