lastfm-nodejs-client 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +11 -11
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -14,13 +14,13 @@ Consider [PNPM](https://pnpm.io/) ▶️
|
|
|
14
14
|
|
|
15
15
|
### Import it
|
|
16
16
|
|
|
17
|
-
Import module
|
|
17
|
+
Import the client module:
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
20
|
import { lastFm } from 'lastfm-nodejs-client';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Import as
|
|
23
|
+
Import the Types as type:
|
|
24
24
|
|
|
25
25
|
```js
|
|
26
26
|
import type { Artist, Track, User, WeeklyAlbum } from 'lastfm-nodejs-client/@types';
|
|
@@ -34,20 +34,20 @@ _Working on getting these into [DefinitelyTyped](https://github.com/DefinitelyTy
|
|
|
34
34
|
const lastFm = LastFmApi();
|
|
35
35
|
const { config, method } = lastFm;
|
|
36
36
|
|
|
37
|
-
const
|
|
38
|
-
const data = await lastFm.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
37
|
+
const getTopArtists = async () => {
|
|
38
|
+
const data = await lastFm.getTopArtists(method.user.top_artists, config.username, 'overall', 200);
|
|
39
|
+
|
|
40
|
+
const { topartists } = data;
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
topartists.artist.map((artist) => artist.mbid);
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
return topartists;
|
|
45
|
+
};
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
🚀 Gives you
|
|
48
|
+
🚀 Gives you:
|
|
49
49
|
|
|
50
|
-

|
|
51
51
|
|
|
52
52
|
## Developing client
|
|
53
53
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthResponse, LovedTracksResponse, RecentTracksResponse, TopAlbumsResponse, TopArtistsResponse, TopTrackResponse, UserResponse, WeeklyAlbumChartResponse, WeeklyArtistChartResponse, WeeklyChartListResponse, WeeklyTrackChartResponse } from '
|
|
1
|
+
import { AuthResponse, LovedTracksResponse, RecentTracksResponse, TopAlbumsResponse, TopArtistsResponse, TopTrackResponse, UserResponse, WeeklyAlbumChartResponse, WeeklyArtistChartResponse, WeeklyChartListResponse, WeeklyTrackChartResponse } from '../@types';
|
|
2
2
|
declare function LastFmApi(): {
|
|
3
3
|
auth: (method: string, user: string, period: string, limit: number) => Promise<AuthResponse>;
|
|
4
4
|
config: {
|
package/package.json
CHANGED