Skip to content

Commit

Permalink
Fixed incorrect example arguments in README.md. Added note about diff…
Browse files Browse the repository at this point in the history
…ering paramaters.
  • Loading branch information
rattletone committed Mar 4, 2019
1 parent fb354fd commit c53f04a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Last.Fm Node Client

[![npm](https://img.shields.io/npm/v/lastfm-node-client.svg)](https://www.npmjs.com/package/lastfm-node-client)
[![Build Status](https://travis-ci.org/rattletone/lastfm-node-client.svg?branch=master)](https://travis-ci.org/rattletone/lastfm-node-client)
[![Coverage Status](https://coveralls.io/repos/github/rattletone/lastfm-node-client/badge.svg?branch=master)](https://coveralls.io/github/rattletone/lastfm-node-client?branch=master)

Expand Down Expand Up @@ -58,7 +59,7 @@ Chaining `.then()`:
lastFm.userGetRecentTracks({
"user": "USER"
})
.then((err, data)) => {
.then(data => {
console.log(data);
};
```
Expand Down Expand Up @@ -86,4 +87,6 @@ lastFm.userGetRecentTracks({
});
```

When callback is passed, methods do not return a `promise`, instead return `undefined`. The `params` parameter is required when the callback parameter is passed.
When callback is passed, methods do not return a `promise`, instead return `undefined`. The `params` parameter is required when a callback argument is passed.

**Note**: Endpoints `Auth.getToken` and `Tag.getTopTags` do not require additional parameters, as such, methods `lastFm.authGetToken()` and `lastFm.tagGetTopTags()` do not accept a `params` argument. A callback can be passed as the first argument.

0 comments on commit c53f04a

Please sign in to comment.