Skip to content

一个能够将字符串类型的歌词数据解析为对象的NPM包

Notifications You must be signed in to change notification settings

xieyezi/xieyziLyricFormat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

说在前面

传入字符串类型歌词,按照正则表达式解析,解析的数据结构为:

{
txt:歌词,
time:ms
}

安装

npm install xieyezi-lyric

用法

import xieyeziLyric form 'xieyezi-lyric';
 var Lyric = new Lyric(lyric,handle);
 console.log(Lyric);
//支持传入一个处理函数“handle”
//js里面的handle函数
_callHandler(i) {
if (i < 0) {
    return;
}
this.handler({
    txt: this.lines[i].txt,
    lineNum: i
})
}

About

一个能够将字符串类型的歌词数据解析为对象的NPM包

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published