0.6.1 • Published 3 years ago
use-last-fm v0.6.1
Stream your currently playing song through last.fm as a React hook.
Features
- 📦 Tiny:
use-last-fm
weighs in at less than 700 bytes minified and gzipped. - 🌳 Universal: we dist esm and cjs modules.
- 👨💻 Developer friendly: Helpful development messages that are stripped away in production
- ⌨️ Strongly typed:
use-last-fm
is written in TypeScript and encourages good practices this way
Installation
With NPM
npm i --save use-last-fm
Or, with yarn:
yarn add use-last-fm
Usage
import { useLastFM } from 'use-last-fm';
const CurrentlyPlaying = () => {
const lastFM = useLastFM('aabbccsmith', '[add api token here]');
if (lastFM.status !== 'playing') {
return <p>Not listening to anything</p>;
}
return (
<p>
Listening to {lastFM.song.name} by {lastFM.song.artist}
</p>
);
};
A full example can be seen in the examples folder
0.6.1
3 years ago
0.6.0
3 years ago
0.2.13
3 years ago
0.3.0
3 years ago
0.4.0
3 years ago
0.2.11
3 years ago
0.2.10
3 years ago
0.2.9
4 years ago
0.2.8
4 years ago
0.2.1
4 years ago
0.2.0
4 years ago
0.1.8
4 years ago
0.2.6
4 years ago
0.1.9
4 years ago
0.2.3
4 years ago
0.2.2
4 years ago
0.2.5
4 years ago
0.2.4
4 years ago
0.1.7
4 years ago
0.1.6
4 years ago
0.1.5
4 years ago
0.1.4
4 years ago
0.1.3
4 years ago
0.1.2
4 years ago
0.1.0
4 years ago