Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
kml-subtitles
Advanced tools
Simple module which parses subtitle files to a javascript object
NodeJS:
npm install kml-subtitles
Let's say we have my.srt SubRip subtitles file:
1
00:00:02,000 --> 00:00:06,000
Subtitle 1.1
Subtitle 1.2
2
00:00:28,967 --> 00:01:30,958
Subtitle 2.1
Subtitle 2.2
var parser = require('kml-subtitles');
var parsedSubtitles = parser({
path : "./", //--> folder path where the subtitle files exits
ext : ['.srt', '.vtt'], //--> subtitles extensions
dest : "./subtitles.js", //--> default destination for exporting the parsed data
name : "subtitles", //--> default name of the object which contains the parsed data (used for exporting to file)
});
var data = parsedSubtitles.data();
data object will look like:
{
my : [{
start: 2,
end: 6,
text: 'Subtitle 1.1<br>Subtitle 1.2'
},
{
start: 28.967,
end: 90.958,
text: 'Subtitle 2.1<br>Subtitle 2.2'
}]
}
2. Export the parsed data to a js file
parsedSubtitles.writeTo('export.js');
the export.js content will look like :
var subtitles = {
my : [{
start: 2,
end: 6,
text: 'Subtitle 1.1<br>Subtitle 1.2'
},
{
start: 28.967,
end: 90.958,
text: 'Subtitle 2.1<br>Subtitle 2.2'
}]
}
FAQs
Simple module which parses subtitle files to a javascript object
We found that kml-subtitles demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.