DDNet - v0.8.1
    Preparing search index...

    Class Map

    Represents a DDNet map.

    const myFavMap = await Map.new('Kobra 4');

    console.log(myFavMap.webPreviewUrl); // "https://ddnet.org/mappreview/?map=Kobra+4"
    console.log(myFavMap.difficulty); // 4
    console.log(myFavMap.maxFinishes[0]);
    // MapMaxFinish {
    // rank: 1,
    // player: 'nameless tee',
    // count: 659,
    // timeSeconds: 1754617.6977539062,
    // timeString: '487:23:37',
    // minTimestamp: 1438545584000,
    // maxTimestamp: 1714287869000
    // }
    Index

    Properties

    biggestTeam: number

    Biggest team to ever finish this map.

    difficulty: number

    Star difficulty of this map.

    finishCount: number

    The total amount of times this map has been finished by any player.

    finishersCount: number

    The total amount of players that have ever finished this map.

    finishes: Finish[]

    Ranks for this map.

    firstFinishTimestamp: null | number

    Timestamp for the first recorded finish on this map.

    height: number

    The height of this map.

    lastFinishTimestamp: null | number

    Timestamp for the last recorded finish on this map.

    mappers: Mapper[]

    Authors of this map.

    maxFinishes: MaxFinish[]

    Top of most amount of finishes on this map.

    medianTimeSeconds: number

    The average finish time of this map in seconds.

    medianTimeString: string

    String formatted average finish time.

    "03:23"
    
    name: string

    The name of this map.

    points: number

    Amount of points awarded for completing this map.

    rankSource: null | RankAvailableRegion

    The region from which ranks are pulled. null for global ranks.

    releasedTimestamp: null | number

    Release timestamp of this map.

    teamFinishes: Finish[]

    Team finishes for this map.

    thumbnailUrl: string

    The direct url of this map's thumbnail image.

    tiles: Tile[]

    Array of tiles used in this map.

    type: Type

    The type of this map.

    url: string

    The url of this map on ddnet.org

    webPreviewUrl: string

    The url to the interactive web preview of this map.

    width: number

    The width of this map.

    clearCache: () => Promise<void> = ...

    Clears the Map.cache.

    Type declaration

      • (): Promise<void>
      • Clears the CacheManager.store.

        Returns Promise<void>

    setTTL: (ttlMS?: number) => void = ...

    Sets the TTL (Time-To-Live) for objects in cache.

    Type declaration

      • (ttlMS?: number): void
      • Sets the CacheManager.ttl.

        Parameters

        • OptionalttlMS: number

          If provided, sets the CacheManager.ttl to this value, otherwise uses the default value.

        Returns void

    Methods

    • Fetch, parse and construct a new Map instance.

      Parameters

      • nameOrUrl: string

        The name or ddnet.org url of this map.

      • OptionalrankSource: null | RankAvailableRegion

        The region to pull ranks from. Omit for global ranks.

        Ignored if map url is used instead of map name.

      • bypassCache: boolean = false

        Wether to bypass the map data cache.

      Returns Promise<Map>

    • Search for a map.

      Parameters

      • value: string

        The value to search for.

      • OptionalrankSource: null | RankAvailableRegion

        The region to pull ranks from in the toMap function from the returned value. Omit for global ranks.

      • force: boolean = false

        Wether to bypass the cache.

      Returns Promise<
          | null
          | {
              mappers: {
                  name: string;
                  toMapper: () => Mapper;
                  toPlayer: () => Promise<Player>;
              }[];
              name: string;
              toMap: () => Promise<Map>;
              type: Type;
          }[],
      >