npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mailru-cloud

v1.0.2

Published

Node.js library for Mail.ru Cloud storage via WebDAV API – upload, download and manage files with ease!

Downloads

7

Readme

📦 mailru-cloud: Node.js Library for Mail.ru Cloud Storage via WebDAV API

mailru-cloud is a lightweight Node.js library that simplifies working with Mail.ru Cloud storage using the WebDAV API. It provides an easy-to-use interface for uploading, downloading, managing files, and organizing folders in your Mail.ru Cloud account.

✨ Features

  • File Management: Upload, download, move, copy, delete, and search for files effortlessly.
  • Folder Operations: Create, list, and delete directories with ease.
  • Secure Authentication: Supports application-specific passwords for enhanced security.
  • Stream-based Data Handling: Handles large files efficiently by utilizing streams.

🔑 How to Generate an Application Password

Before using the library, you'll need to generate an application-specific password for Mail.ru Cloud. Here's how:

  1. Go to your Mail.ru Account Security Settings.
  2. Click "Пароли для внешних приложений" ("Passwords for external applications").
  3. Add a descriptive name (e.g., "WebDAV Cloud").
  4. Select "Полный доступ к Облаку (WebDAV)" ("Full access to Cloud (WebDAV)") for permission.
  5. Copy the generated password—it will only appear once!
  6. Use this password in your code.

🚀 Getting Started

Install the package using npm or yarn:

npm install mailru-cloud
# or
yarn add mailru-cloud

Import the library and initialize the client using MailRuCloud:

import { MailRuCloud } from 'mailru-cloud'

const cloud = new MailRuCloud({
  username: '[email protected]', // Full email address
  password: 'your_application_password', // Generated password
})

📥 Uploading Files

Use the upload method to upload files to your Mail.ru Cloud:

import { createReadStream } from 'fs'

await cloud.file.upload(
  createReadStream('./local_file.txt'),
  '/cloud_directory/file.txt'
)

📤 Downloading Files

Download files from Mail.ru Cloud using the download method:

import { createWriteStream } from 'fs'

const fileStream = await cloud.file.download('/cloud_directory/file.txt')
fileStream.pipe(createWriteStream('./downloaded_file.txt'))

🎯 Finding Files

The find method allows you to search for specific files based on their names, ETags, or other criteria. Both filename and etag parameters are optional, allowing flexible searches based on one or both criteria. Here's how to use it:

const foundFile = await cloud.file.find({
  filename: 'example.txt', // Search by filename
  etag: '12345', // Optional: Search by ETag
  folderPath: '/cloud_directory/', // Specify the starting directory
  recursive: true, // Enable recursive search
  sensitive: false, // Case-insensitive search
})

console.log(foundFile) // Output the result

Parameters

  • filename (optional): The name of the file you're searching for. Can be combined with etag for precise searches.
  • etag (optional): An ETag for the file, which can help identify the latest version. Can be used alone or together with filename.
  • folderPath (default: /): The directory where the search starts.
  • recursive (default: false): Whether to perform a recursive search through subdirectories.
  • sensitive (default: false): Whether the search should be case-sensitive.

📋 Managing Files

Moving Files

Move files within your Mail.ru Cloud using the move method:

await cloud.file.move('/current_path/file.txt', '/new_path/file.txt')

Copying Files

Copy files within your Mail.ru Cloud using the copy method:

await cloud.file.copy('/original_path/file.txt', '/duplicate_path/file.txt')

Deleting Files

Remove files from your Mail.ru Cloud using the remove method:

await cloud.file.remove('/path_to_delete/file.txt')

🗂️ Managing Folders

Creating Directories

Use the create method to create new directories:

await cloud.folder.create('new_folder', '/parent_directory/')

Listing Contents

List the contents of a directory using the list method:

const folderContents = await cloud.folder.list('/parent_directory/')
console.log(folderContents)

Deleting Directories

Delete directories recursively using the delete method:

await cloud.folder.delete('/parent_directory/new_folder/')

❓ Troubleshooting

If you're experiencing issues with authentication or file operations, double-check that you've correctly generated and used your application-specific password. Also ensure that the paths specified are correct and that the requested actions align with the limitations imposed by Mail.ru Cloud's WebDAV API.

💻 License

This project is licensed under the MIT License—see the LICENSE file for more information.