
Research
/Security News
Shai Hulud Strikes Again (v2)
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.
lrc parser and runner
npm
npm i -S lrc-kit
import
import { Lrc } from 'lrc-kit';
parse lyric
var lrc = Lrc.parse(`
[ti:Title]
[ar:Lyrics artist]
[00:09.010][00:30.000]i guess you're my creep tonight
`)
lrc.info
// { ti: 'Title', ar: 'Lyrics artist' }
lrc.lyrics
// [{
// content: "i guess you're my creep tonight",
// timestamp: 9.01
// }, {
// content: "i guess you're my creep tonight",
// timestamp: 30.0
// }]
make lyric
var lrc = new Lrc()
lrc.info['ar'] = 'Lyrics artist'
lrc.lyrics.push({
content: "i guess you're my creep tonight",
timestamp: 9.01,
})
lrc.lyrics.push({
content: "i guess you're my creep tonight",
timestamp: 30.0,
})
lrc.toString()
// [ar:Lyrics artist]
// [00:30.00][00:09.01]i guess you're my creep tonight
lrc.toString({combine: false})
// [ar:Lyrics artist]
// [00:09.01]i guess you're my creep tonight
// [00:30.00]i guess you're my creep tonight
lrc.offset(-3)
lrc.toString()
// [ar:Lyrics artist]
// [00:27.00][00:06.01]i guess you're my creep tonight
Lrc.parse(text): parse lyirc text and return a lrc object
Lrc object
{
'ar': 'Lyrics artist',
'al': 'Album where the song is from',
'ti': 'Lyrics (song) title',
'au': 'Creator of the Songtext',
'length': 'music length, such as 2:50',
'by': 'Creator of the LRC file',
'offset': '+/- Overall timestamp adjustment in milliseconds, + shifts time up, - shifts down',
're': 'The player or editor that created the LRC file',
've': 'version of program',
}
[
{
content: "i guess you're my creep tonight",
timestamp: 9.01,
},
{
content: "The way you knock me off my feet",
timestamp: 12.08,
},
]
lrc.offset(offset) offset all lyrics
lrc.toString(options) generate lyric string
import
import { Runner } from 'lrc-kit';
run
var runner = new Runner(Lrc.parse(...))
audio.addEventListener('timeupdate', () => {
runner.updateTime(audio.currentTime)
var lyric = runner.curLyric()
// or
var lyric = runner.getLyric(runner.curIndex())
lyric
// {
// content: "i guess you're my creep tonight",
// timestamp: 9.01
// }
})
// Modify lyric
runner.lrc.lyrics.push({
content: "Now i can't tell my left form right",
timestamp: 17.3,
})
runner.lrcUpdate() // Must call lrcUpdate() when update lyrics
new Runner(lrc = new Lrc(), offset=true)
lrc lrc objectoffset parse lrc.info.offset if offset is trueRunner object
runner.lrc.inforunner.lrc.lyricsFAQs
lrc parser, maker, runner
We found that lrc-kit 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.

Research
/Security News
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.