-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No login storage #82
Comments
You're trying to use promises, this library use callbacks (because it was created before promises were a huge thing). The first argument from callbacks is the error, which in your case is null as there is no error. Well, I don't know why you're creating an options object and not using it. You don't need to use const { Storage } = require('megajs')
const storage = new Storage({
email: process.env.MEGA_EMAIL,
password: process.env.MEGA_PASSWORD
})
storage.on('ready', () => {
// do something with storage, like...
storage.upload('hello world.txt', 'hello world', error => {
if (error) return console.error(error)
console.log('the file was uploaded')
})
}) Check the storage test case for more examples (it uses Notice that there are plans to rewrite this library using promises and TypeScript. Would be great if you can contribute in some way. |
Hello, @qgustavor thanks for your comments. Upgrade this lib sounds good I have some experience with Typescript which is the plan to start rewriting, How can I help? |
I am trying to use this lib to have access to my mega files, but when I try to log in I also get null. Also I received and warning email from Mega. Please can you help to know what I am doing wrong?
const options = {email: '[email protected]', password: 'xxxxx'}
const storage = new mega.Storage({email: '[email protected]', password: 'Asterisco123', autologin: false})
await storage.login((result)=>{
console.log('result', result)
})
The text was updated successfully, but these errors were encountered: