Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
srt-validator
Advanced tools
yarn add srt-validator
Or
npm install srt-validator --save
SRT file (also known as SubRip Subtitle file) is a plain-text file that contains subtitles with the start and end timecodes of the text to ensure the subtitles match the audio. It also inclues the sequential number of subtitles. A sample SRT looks like this:
1
00:02:17,440 --> 00:02:20,375
Senator, we're making
our final approach into Coruscant.
2
00:02:20,476 --> 00:02:22,501
Very good, Lieutenant.
This library only exposes a single util function srtValidator(input)
which takes a string as an input and validates it against the SRT spec. The output of this function is an array of error objects. If the array is empty then there are no errors and the SRT is valid.
import srtValidator from 'srt-validator';
const srtString = `1
00:02:17,440 --> 00:02:20,375
Senator, we're making
our final approach into Coruscant.
2
00:02:20,476 --> 00:02:22,501
Very good, Lieutenant.`;
srtValidator(srtString);
This will return:
[];
import srtValidator from 'srt-validator';
const srtString = `1
02:01:17,440 --> 02:00:20,375
Forget it, Jake.
It's Chinatown.`;
srtValidator(srtString);
This will return:
[
{
errorCode: 'validatorErrorStartTime',
lineNumber: 2,
message: 'start time should be less than end time',
validator: 'CaptionTimeSpanValidator',
},
];
FAQs
SrtValidator
The npm package srt-validator receives a total of 3,760 weekly downloads. As such, srt-validator popularity was classified as popular.
We found that srt-validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.