Smilodon is a Javascript library for Mastodon's API.
This project is really new and few functionalities are present, but the structure is here.
This library needs to be connected to a running instance of Mastodon (https://mastodon.social
for example). The API does not allow to create a new user so you need to create one on the default interface before use the library.
Using NPM:
npm install smilodon
Using GitHub (last version):
git clone https://github.com/5ika/smilodon
yarn install
yarn build
import Smilodon from 'smilodon';
const smilodon = new Smilodon('MyAppName');
smilodon.register('https://mastodon.social');
smilodon.authorize('myEmail', 'myPassword');
const API = smilodon.api();
API.getUserCredentials()
.then((myCreds) => console.log({myCreds}))
.catch((error) => console.error(error));
First, add user credentials in the test.js
file. Then, you can run tests with Mocha:
yarn test
The project is really young, everyone is invited to contribute.
For the moment, we need to add support for every endpoints of the Mastodon API.
This project is licensed under the MIT License - see the LICENSE.md file for details