Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
audio-cover
Advanced tools
Get the cover from an audio file in the browser
$ yarn add audio-cover
https://zzarcon.github.io/audio-cover
import getAudioCover from 'audio-cover';
try {
const coverSrc = await getAudioCover(file);
console.log('base64 encoded cover', coverSrc)
} catch (e) {
console.log('no cover available', e)
}
getAudioCover: (file: File) => Promise<string>
given a file, returns a promise with the cover in base64, otherwise will reject if cover is not present
import getAudioCover from 'audio-cover';
class App extends React.Component {
state = {}
onChange = async (e) => {
try {
const file = e.target.files[0];
const coverSrc = await getAudioCover(file);
this.setState({coverSrc});
} catch(e) {
console.log('error:', e)
}
}
render() {
const {coverSrc} = this.state;
return (
<div>
<input type="file" onChange={this.onChange}/>
<img src={coverSrc} />
</div>
)
}
}
FAQs
Get the cover from an audio file in the browser
We found that audio-cover 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.