Skip to content

litecanvas/plugin-migrate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plugin Migrate for Litecanvas

Sometimes upgrading litecanvas to a new version can be a lot of work. This plugin makes this easier, by restoring the Litecanvas APIs that were removed in newer versions, and additionally shows warnings in the browser console when removed and/or deprecated APIs are used.

Install

NPM: npm i @litecanvas/plugin-migrate

CDN: https://unpkg.com/@litecanvas/plugin-migrate/dist/dist.js

Usage

In that example, clear and print will not cause errors, because this plugin restores these old functions that no longer exist in the latest versions of Litecanvas.

litecanvas({
  loop: { init, draw },
})

use(pluginMigrate, {
  // set to `false` to not show warnings in the console (default is true)
  warnings: true,
})

function draw() {
  clear(0)
  print(0, 0, "Hello World")
}

About

⏪ A plugin to help upgrade your code to newer versions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published