Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Faster response time and best practice #3

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
184 changes: 100 additions & 84 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,124 +1,140 @@
# Deezer Public API wrapper

This is *Nodejs* wrapper for the [Deezer Public API](http://developers.deezer.com/api) that return promises.
This is **[Node.js](https://nodejs.org/en/download/)** wrapper for the [Deezer Public API](http://developers.deezer.com/api) that return promises.

This is forked from https://github.com/zaosoula/deezer-public-api, but it has modifications and uses a much faster HTTP library, giving you the most immediate results.

## Installation
npm install deezer-public-api --save

npm install @muhimur/deezer-public-api

## Usage example

```js
const DeezerPublicApi = require('deezer-public-api');
let deezer = new DeezerPublicApi();

//Search an artist
deezer.search.artist('ILYSH').then(function(result) {
console.log(result);
});

//Get info for the given artist id
deezer.artist('58671252').then(function(result) {
console.log(result);
});

//Get album list for the given artist id
deezer.artist.albums('58671252').then(function(result) {
console.log(result);
});
const DeezerPublicApi = require("@muhimur/deezer-public-api");
const deezer = new DeezerPublicApi();

// Search a track
deezer.track("493894782").then(result => console.log(result));

// Search an artist
deezer.search.artist("ILYSH").then(result => console.log(result));

// Get info for the given artist id
deezer.artist("58671252").then(result => console.log(result));

// Get album list for the given artist id
deezer.artist.albums("58671252").then(result => console.log(result));
```

## Available methods

##### Album
* album(`id`, `limit`, `index`)
* album.comments(`id`, `limit`, `index`)
* album.fans(`id`, `limit`, `index`)
* album.tracks(`id`, `limit`, `index`)

- album(`id`, `limit`, `index`)
- album.comments(`id`, `limit`, `index`)
- album.fans(`id`, `limit`, `index`)
- album.tracks(`id`, `limit`, `index`)

##### Artist
* artist(`id`, `limit`, `index`)
* artist.top(`id`, `limit`, `index`)
* artist.albums(`id`, `limit`, `index`)
* artist.comments(`id`, `limit`, `index`)
* artist.fans(`id`, `limit`, `index`)
* artist.related(`id`, `limit`, `index`)
* artist.radio(`id`, `limit`, `index`)
* artist.playlists(`id`, `limit`, `index`)

- artist(`id`, `limit`, `index`)
- artist.top(`id`, `limit`, `index`)
- artist.albums(`id`, `limit`, `index`)
- artist.comments(`id`, `limit`, `index`)
- artist.fans(`id`, `limit`, `index`)
- artist.related(`id`, `limit`, `index`)
- artist.radio(`id`, `limit`, `index`)
- artist.playlists(`id`, `limit`, `index`)

##### Chart
* chart(`limit`, `index`)
* chart.tracks(`limit`, `index`)
* chart.albums(`limit`, `index`)
* chart.artists(`limit`, `index`)
* chart.playlists(`limit`, `index`)
* chart.podcasts(`limit`, `index`)

- chart(`limit`, `index`)
- chart.tracks(`limit`, `index`)
- chart.albums(`limit`, `index`)
- chart.artists(`limit`, `index`)
- chart.playlists(`limit`, `index`)
- chart.podcasts(`limit`, `index`)

##### Comment
* comment(`id`, `limit`, `index`)

- comment(`id`, `limit`, `index`)

##### Editorial
* editorial(`id`, `limit`, `index`)
* editorial.selection(`id`, `limit`, `index`)
* editorial.charts(`id`, `limit`, `index`)
* editorial.releases(`id`, `limit`, `index`)

- editorial(`id`, `limit`, `index`)
- editorial.selection(`id`, `limit`, `index`)
- editorial.charts(`id`, `limit`, `index`)
- editorial.releases(`id`, `limit`, `index`)

##### Episode
* episode(`id`, `limit`, `index`)

- episode(`id`, `limit`, `index`)

##### Genre
* genre(`id`, `limit`, `index`)
* genre.artists(`id`, `limit`, `index`)
* genre.podcasts(`id`, `limit`, `index`)
* genre.radios(`id`, `limit`, `index`)

- genre(`id`, `limit`, `index`)
- genre.artists(`id`, `limit`, `index`)
- genre.podcasts(`id`, `limit`, `index`)
- genre.radios(`id`, `limit`, `index`)

##### Infos
* infos()

- infos()

##### Options
* options()

- options()

##### Playlist
* playlist(`id`, `limit`, `index`)
* playlist.comments(`id`, `limit`, `index`)
* playlist.fans(`id`, `limit`, `index`)
* playlist.tracks(`id`, `limit`, `index`)
* playlist.radio(`id`, `limit`, `index`)

- playlist(`id`, `limit`, `index`)
- playlist.comments(`id`, `limit`, `index`)
- playlist.fans(`id`, `limit`, `index`)
- playlist.tracks(`id`, `limit`, `index`)
- playlist.radio(`id`, `limit`, `index`)

##### Podcast
* podcast(`id`, `limit`, `index`)
* podcast.episodes(`id`, `limit`, `index`)

- podcast(`id`, `limit`, `index`)
- podcast.episodes(`id`, `limit`, `index`)

##### Radio
* radio(`id`, `limit`, `index`)
* radio.genres(`limit`, `index`)
* radio.top(`limit`, `index`)
* radio.lists(`limit`, `index`)
* radio.tracks(`id`, `limit`, `index`)

- radio(`id`, `limit`, `index`)
- radio.genres(`limit`, `index`)
- radio.top(`limit`, `index`)
- radio.lists(`limit`, `index`)
- radio.tracks(`id`, `limit`, `index`)

##### Track
* track(`id`, `limit`, `index`)

- track(`id`, `limit`, `index`)

##### User
* user(`id`, `limit`, `index`)
* user.albums(`id`, `limit`, `index`)
* user.artists(`id`, `limit`, `index`)
* user.charts(`id`, `limit`, `index`)
* user.charts.tracks(`id`, `limit`, `index`)
* user.charts.albums(`id`, `limit`, `index`)
* user.charts.playlists(`id`, `limit`, `index`)
* user.charts.artists(`id`, `limit`, `index`)
* user.flow(`id`, `limit`, `index`)
* user.followings(`id`, `limit`, `index`)
* user.followers(`id`, `limit`, `index`)
* user.playlists(`id`, `limit`, `index`)
* user.podcasts(`id`, `limit`, `index`)
* user.radios(`id`, `limit`, `index`)
* user.tracks(`id`, `limit`, `index`)

- user(`id`, `limit`, `index`)
- user.albums(`id`, `limit`, `index`)
- user.artists(`id`, `limit`, `index`)
- user.charts(`id`, `limit`, `index`)
- user.charts.tracks(`id`, `limit`, `index`)
- user.charts.albums(`id`, `limit`, `index`)
- user.charts.playlists(`id`, `limit`, `index`)
- user.charts.artists(`id`, `limit`, `index`)
- user.flow(`id`, `limit`, `index`)
- user.followings(`id`, `limit`, `index`)
- user.followers(`id`, `limit`, `index`)
- user.playlists(`id`, `limit`, `index`)
- user.podcasts(`id`, `limit`, `index`)
- user.radios(`id`, `limit`, `index`)
- user.tracks(`id`, `limit`, `index`)

##### Search
* search(`options`, `order`, `limit`, `index`)
* search.artist(`query`, `order`, `limit`, `index`, `strict`)
* search.playlist(`query`, `order`, `limit`, `index`, `strict`)
* search.podcast(`query`, `order`, `limit`, `index`, `strict`)
* search.radio(`query`, `order`, `limit`, `index`, `strict`)
* search.track(`query`, `order`, `limit`, `index`, `strict`)
* search.user(`query`, `order`, `limit`, `index`, `strict`)

- search(`options`, `order`, `limit`, `index`)
- search.artist(`query`, `order`, `limit`, `index`, `strict`)
- search.playlist(`query`, `order`, `limit`, `index`, `strict`)
- search.podcast(`query`, `order`, `limit`, `index`, `strict`)
- search.radio(`query`, `order`, `limit`, `index`, `strict`)
- search.track(`query`, `order`, `limit`, `index`, `strict`)
- search.user(`query`, `order`, `limit`, `index`, `strict`)
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "deezer-public-api",
"version": "1.0.4",
"description": "This is Nodejs wrapper for the Deezer Public API that return promises.",
"name": "@muhimur/deezer-public-api",
"version": "1.0.23",
"description": "This is Nodejs wrapper for the Deezer Public API that return promises. Forked from deezer-public-api with a faster response time.",
"keywords": [
"deezer-api",
"deezer",
Expand All @@ -19,15 +19,15 @@
"test": "node test/index.js"
},
"dependencies": {
"node-fetch": "2.6.1"
"petitio": "^1.3.2"
},
"devDependencies": {},
"repository": {
"type": "git",
"url": "https://github.com/zaosoula/deezer-public-api.git"
"url": "git+https://github.com/muhimur9049/deezer-public-api.git"
},
"bugs": {
"url": "https://github.com/zaosoula/deezer-public-api/issues"
"url": "https://github.com/muhimur9049/deezer-public-api/issues"
},
"homepage": "https://github.com/zaosoula/deezer-public-api"
"homepage": "https://github.com/muhimur9049/deezer-public-api"
}
Loading