1.2.1 • Published 10 months ago

bangumi v1.2.1

Weekly downloads
5
License
Apache-2.0
Repository
github
Last release
10 months ago

A simple Node.js client library for legacy Bangumi REST API.

Installation

npm install bangumi --save

Getting Started

Setup API

const Bangumi = require('bangumi');
const bgm = new Bangumi({
    access_token: "fill in your access token here"
});

How to get and refresh access token

This library currently does not handle token requests or renew. Please follow these steps to get your valid token.

Once you get a new token, it can be replaced live with

bgm.setAccessToken(your_token);

Examples of Usage

Set up custom promise library

bgm.setPromiseProvider(require('bluebird'));

Using promise

bgm.search('天元突破',{
	responseGroup: 'small',
	max_results:2,
	start:1,
	type:2
}).then(data => console.log(JSON.stringify(data))).catch(console.error);

Using callback

bgm.search('天元突破',{
	responseGroup: 'small',
	max_results:2,
	start:1,
	type:2
},function(err, data){
	console.log(JSON.stringify(data));
});

Changelog

See Releases

Documentation

See documentation site and Bangumi API official docs

1.2.1

10 months ago

1.2.0

2 years ago

1.1.1

5 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.1.0

12 years ago