npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mls-js-sdk

v2.1.2

Published

MLS API SDK for JavaScript.

Downloads

16

Readme

MLS API SDK for JavaScript

Develop and deploy applications, mobile and web, with popular JavaScript Frameworks using MLS API SDK for JavaScript.

Install

npm i mls-js-sdk

# or

yarn add mls-js-sdk

Example of Usage

import {
  login, getAllHistoricalData, getHistoricalDataById,
  getAllRealTimeData, getRealTimeDataById, getAllPlayers,
  getPlayerById, getAllAssists, getAssistById, getAllOffence,
  getOffenceById, getAllTopScorers, getTopScorerById, getAllTeams,
  getTeamById, getAllFixtures, getFixtureById, getAllStandings,
  getStandingById, getAllNews, getNewsById,
} from 'mls-js-sdk';

(async () => {
    try {
        const credentials = {
            username: "your_username",
            password: "your_password"
        };

        const loginResponseData = await login(credentials);
        console.log("Login response data:", loginResponseData);

        const token = loginResponseData.Document;

        const allHistoricalData = await getAllHistoricalData(token);
        console.log("All historical data:", allHistoricalData);

        const id = "uuid";
        const historicalDataById = await getHistoricalDataById(id, token);
        console.log(`Historical data by id (${id}):`, historicalDataById);

        const allRealTimeData = await getAllRealTimeData(token);
        console.log("All real-time data:", allRealTimeData);

        const realTimeId = "uuid";
        const realTimeDataById = await getRealTimeDataById(realTimeId, token);
        console.log(`Real-time data by id (${realTimeId}):`, realTimeDataById);

        const playersQueryParams: PlayersQueryParams = {
            limit: 5,
            offset: 0
        };
        const allPlayers = await getAllPlayers(token, playersQueryParams);
        console.log("All players:", allPlayers);

        const playerId = "uuid";
        const playerDataById = await getPlayerById(playerId, token);
        console.log(`Player data by id (${playerId}):`, playerDataById);

        const allAssists = await getAllAssists(token);
        console.log("All assists:", allAssists);

        const assistId = "uuid";
        const assistDataById = await getAssistById(assistId, token);
        console.log(`Assist data by id (${assistId}):`, assistDataById);

        const allOffence = await getAllOffence(token);
        console.log("All offence:", allOffence);
    
        const offenceId = "uuid";
        const offenceDataById = await getOffenceById(offenceId, token);
        console.log(`Offence data by id (${offenceId}):`, offenceDataById);

        const allTopScorers = await getAllTopScorers(token);
        console.log("All top scorers:", allTopScorers);
    
        const topScorerId = "uuid";
        const topScorerDataById = await getTopScorerById(topScorerId, token);
        console.log(`Top scorer data by id (${topScorerId}):`, topScorerDataById);

        const allTeams = await getAllTeams(token);
        console.log("All teams:", allTeams);
    
        const teamId = "uuid";
        const teamDataById = await getTeamById(teamId, token);
        console.log(`Team data by id (${teamId}):`, teamDataById);

        const allFixtures = await getAllFixtures(token);
        console.log("All fixtures:", allFixtures);
    
        const fixtureId = "uuid";
        const fixtureDataById = await getFixtureById(fixtureId, token);
        console.log(`Fixture data by id (${fixtureId}):`, fixtureDataById);

        const allStandings = await getAllStandings(token);
        console.log("All standings:", allStandings);
    
        const standingId = "uuid";
        const standingDataById = await getStandingById(standingId, token);
        console.log(`Standing data by id (${standingId}):`, standingDataById);

        const allNews = await getAllNews(token);
        console.log("All news:", allNews);
    
        const newsId = "uuid";
        const newsDataById = await getNewsById(newsId, token);
        console.log(`News data by id (${newsId}):`, newsDataById);

    } catch (error) {
        console.error("Error during fetching data:", error);
    }
})();

The MLS API documentation is available here. If you need further assistance, don't hesitate to contact us.

License

This project is licensed under the BSD 3-Clause License.

Copyright

(c) 2020 - 2024 Hori Systems Limited.