- This is based on tonistiigi's mega library.
- This is all unofficial, based on developer guide and site source.
- Make sure you agree with MEGA's Terms of Service before using it.
- Maybe an official SDK will probably be released in the future here: https://github.com/meganz/
npm install megajs
const mega = require('megajs') // or import mega from 'megajs'
You can also load it in a browser using
<script src="https://unpkg.com/megajs/dist/main.node-cjs.js"></script>, which exports the library in the
mega global variable. You can also use
import * as mega from 'https://unpkg.com/megajs/dist/main.browser-es.js'.
For more details, API documentation and examples check wiki: https://github.com/qgustavor/mega/wiki
For CLI usage check MEGAJS CLI: https://github.com/qgustavor/megajs-cli
Only part of the file related API is implemented. For now implementing contact and chat functions seems out of scope.
This module works in the browser: the "main.browser-umd.js" is a build using the UMD format where Node specific modules, like crypto and request modules, were replaced with browser equivalents. If you want to use tree shaking then use the "main.browser-es.js" bundle. This module wasn't tested in other environments.
This package started as a fork, with the following objectives:
- Make the original package work in browsers again: even following the instructions from the original library it stopped working because some dependencies used
__proto__, which is non-standard and isn't supported in many browsers. Also the updated versions of those libraries broke backyards compatibility;
- Reduce dependencies and replace big dependencies with smaller ones, like crypto libraries, which usually are huge;
- Make tests work again after the changes above;
- Continue the original library development implementing new features and improving performance.
When contributing fork the project, clone it, run
npm install, change the library as you want, run tests using
npm run test and build the bundled versions using
npm run build. Before creating a pull request, please, run tests.