Skip to content
Version: v1.4
On this page

Notable Versions

  • Failed database writes now reject instead of only being logged, and connect() rejects if it fails.
  • XP no longer goes below 0, and fractional levels are rounded down.
  • levelUp now also fires for new users who start above level 0.
  • lvlRole() now throws when the user ID or server ID is missing.
  • Add typings for roleSetup, options, addXP({ min, max }), lvlbar, lvlbarBg and the pie chart.
  • Accept any Message or Client-shaped object in the typings, fixing TypeScript errors in ESM projects.
  • Fix a user only being able to have XP in one server. connect() replaces the old index, so it needs permission to manage indexes.
  • Fix addXP(), addLevel() and setXP() for users with no record, and simultaneous calls losing XP.
  • Fix levelUp firing incorrectly, and 0 or negative values being mishandled.
  • Fix charts() throwing when called without options.
  • Fix leaderboard() with auto_purge deleting members whose lookup only failed.
  • Fix a billion showing as 1T in fetch() and leaderboard().
  • Fix smaller issues in reset(), create() and roleSetup.remove().
  • Replace mongoose with the official mongodb driver (^6.22.0). Install mongoose yourself if you used it through simply-xp.
  • Remove chart.js; charts() now draws its own charts.
  • Bump @napi-rs/canvas from v0.1.88 to v1.1.1.
  • Limit the discord.js peer dependency to ^13.12.0 || ^14.19.0.
  • Require Node.js 16.20.1 and MongoDB 4.2 or newer (Bun 1.1.39 also works).
  • Install size drops from 28 packages / 70 MB to 15 packages / 44 MB.
  • Load about 40% faster, with 40–70% faster database calls and about 35% less peak memory. connect() takes about 10 ms longer, once.
  • setXP() now returns { xp, level }.
  • Rewrite the internals, add npm test and replace eslint with oxlint and oxfmt.
  • Redraw charts() with readable text on any background, the bundled font and rotating labels.

  • Refactor leaderboard and rank position calculation into a new utility for efficiency and code reuse.
  • Add a compound index to the level model for improved leaderboard query performance.
  • Improve leaderboard auto-purge logic and cleaned up code style.
  • Refactor rank() image to scale background images properly, fixing stretching issues.
  • Replace Baloo-Regular.ttf to Baloo2-Regular.woff2 for better performance and smaller size.
  • Bump @napi-rs/canvas from v0.1.43 to v0.1.88.

  • Fix leaderboard not properly showing users when some have left the server.

  • Add eslint to the project. (#c567aa5)
  • Add auto_purge option to connect() (#02958e9)
  • Fix charts() not properly reporting when user doesn’t have canvas installed. (#9cdaf7b)
  • Fix rank() not buffering image as image/webp. (#9cdaf7b)
  • Fix leaderboard() Position & Cache issues.
  • Bump mongoose from V6 to V7.
  • Bump @napi-rs/canvas from v0.1.28 to v0.1.41.
  • Improved Code Quality.
  • Improved Performance.

  • Fix addLevel() only adding 1 level.
  • Fix roleSetup.find() returning only 1 Role ID.
  • Update UI of rank(), including a new default background.

  • Replace canvas with @napi-rs/canvas for better performance, and to fix node-gyp issues.
  • Update rank() to use @napi-rs/canvas.

  • Fix position not actually working in charts(). (#72a1ac8)
  • Fix addLevel not correcting XP, and not adding specified level.
  • Replace chart.js-image with chart.js to remove vulnerabilities & improve performance. (#b57ad49)
  • Eliminate discord.js functions from being used in the package. (#72a1ac8)

  • Fix reset() not saving user sometimes. (#9ac31bc)
  • Bump chart.js-image from v5 to v6
  • rank() Can now count to an undecillion! (#9ac31bc)