1.1.1 • Published 10 months ago

javascript-ampache v1.1.1

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
10 months ago

javascript-ampache

A JS client for the Ampache API written in Typescript.

Installation

npm install javascript-ampache

Usage

Import javascript-ampache module in your project and initialize it with the URL to your server e.g. http://music.com.au

import AmpacheAPI from "javascript-ampache";

const API = new AmpacheAPI({
  url: "http://pathToYourAmpacheServer",
  sessionKey: yourSessionAuthKey,
}); // debug: true - will log the final GET to console

// either set the session key at time of instantiation or set/update with:
API.setSessionKey(yourSessionAuthKey);

let allUsers = API.users();

let thisAlbum = API.album({ filter: 123 });

let results = API.advancedSearch({
  type: "album",
  operator: "and",
  random: 1,
  limit: 20,
  rules: [
    ["title", 0, "monkey"], // Title contains 'monkey'
    ["myrating", 2, 4], // Rating is 4 stars
  ],
});

Build

npm run build

Special thanks

https://lyamkin.com/blog/how-to-build-api-client-library-in-js/ & https://github.com/ilyamkin/dev-to-js

1.1.1

10 months ago

1.1.0

10 months ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.1

2 years ago