Migrating from old versions
Migrating from tonistiigi's mega
If you are migrating from tonistiigi's mega package you can follow instructions for how to migrate from V0 to V1 below, as V0 is mostly backyards compatible with tonistiigi's mega.
The only issue when migrating is that MEGAJS includes ES Module exports which are incompatible with the old CommonJS exports because tree-shaking reasons. If you were importing tonistiigi's mega using ES Modules you will need to fix your imports: instead of a single default export the library exports multiple classes and helper functions.
If you migrate you will get features which are not available in tonistiigi's mega like:
- File and folder sharing
- File management functions
- Support for browsers (seems using Browserify stop working at sometime)
- Tree shaking when using ES Modules
- Native crypto on Node.js
If you migrate to MEGAJS V1 you will also get:
- Support for V2 accounts
- Support for promises
- Helper methods for transversing directories
- Actively supported (mostly via pull requests by collaborators)
- Partial support for Deno and similar platforms
Migrating from V0 to V1
Most of the changes from V0 to V1 are internal changes, like replacing request with fetch and migrating dependencies, but there were a few breaking changes.