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

wetransfert

v2.4.0

Published

Download/Upload wetransfer content with nodeJS - Unofficial API for wetransfer

Readme

node-wetransfert

Download wetransfer content with nodeJS ! - Unofficial API for wetransfer

Known Vulnerabilities

CodeQL analysis

Regression tests

Changelog

  • 2.4.0
    • Fix download
    • Login/Download no longer working
  • 2.3.10
    • Merge #36 Remove csrf trim
  • 2.3.9
    • Fix minor security issue that allows fake wetransfer domains #33
  • 2.3.7 / 2.3.8
    • Allowing subdomain url (https://orgrimarr.wetransfer.com)
    • Fix dep security issue #30
    • Fix dep security issue #31
  • 2.3.6
    • Fix dep security issue (node-fetch)
  • 2.3.5
    • Upgrade libs versions
    • Fix dep security issue #28
  • 2.3.4
    • Fix uploadFileStream is not defined for big files #27
    • Fix dep security issue #26
    • Fix dep security issue #25
    • Fix dep security issue #24
    • Fix dep security issue #23
  • 2.3.3
    • Fix download for Nomal url (Fix get recipient id)
  • 2.3.2
    • Fix upload issues (CSRF token was invalid)
  • 2.3.1
    • Fix download/upload due to wetranfer changes
  • 2.3.0
    • Add proxy support
  • 2.2.0
    • Remove deprecated request-* libs and use node-fetch instead
    • Fix wetransfer upload (send emails)
  • 2.1.5
    • Fix upload (get link)
    • Fix download
    • Add download file by ID
    • Upgrade dependencies
    • Upload (send email) still broken. Wetransfer add a captcha. I will implement download via wetransfer account (user/password) soon
  • 2.1.4
    • Fix upload !
  • 2.1.3
    • Fix dependencies security issues
    • Fix download (Thanks @cylwin). The upload part is still broken

Table of content

Install

npm install wetransfert --save
or
yarn add wetransfert

Tested in node 18.x

You can require the module like this

const { upload, download, getInfo, isValidWetransfertUrl } = require('wetransfert');

Use custom proxy

  • Add HTTP_PROXY or HTTPS_PROXY environement variable

Download weTransfer content from url

download(url, folder)

The function take a valid wetransfer url and a destination folder

Simply return a PromiseProgress

The response is an object describing the weTransfert content

Example

const { download } = require('wetransfert');

download(myUrl, myDestinationFolder)
  .onProgress(progress => {
    console.log('progress', progress);
  })
  .then((res) => {
    console.log(res); // success
  })
  .catch((err) => {
    console.error('error  ', err);
  });

Download weTransfer file by ID

download(url, folder, fileIds)

  • fileIds: An array of wetransfer file id

Example

const { download } = require('wetransfert');

download(myUrl, myDestinationFolder, ['aaaaaaaaa'])
  .onProgress(progress => {
    console.log('progress', progress);
  })
  .then((res) => {
    console.log(res); // success
  })
  .catch((err) => {
    console.error('error  ', err);
  });

/!\ If your transfer contain only one file, wetransfer does not zip the content. Be carefull when using the downloadPipe function. You can obtain all files information using the getInfo function.

Download weTransfer content from url pipe response

  • (progress with callback)

downloadPipe(url)

This function take a valid wetransfer url. Like the classique download function, you can specify the file ids you want to download. downloadPipe(response.shortened_url, ["fileID"])

It return a Promise and resolve a ReadableStream you can pipe.

If you need a progress, you can obtain the total size with the getInfo function

Example

const { downloadPipe } = require('wetransfert');

downloadPipe(response.shortened_url, null)
  .then(files => {
      files.pipe(fs.createWriteStream("/home/orgrimarr/wetransfer/myDownload.zip"))
  })
  .catch(console.error)

/!\ If your transfer contain only one file, wetransfer does not zip the content. Be carefull when using the downloadPipe function. You can obtain all files information using the getInfo function.

isValidWetransfertUrl

Return a NodeJS URL object if the url is valid.

If not, it return false

Get information about weTransfert url

Example

const { getInfo } = require('wetransfert');

getInfo('myWeTransfertURL')
    .then((data) => {
      console.log('success  ', data);
    })
    .catch((err) => {
      console.error('error  ' + err);
    })

Response Example

{
  "content": {
    "id": "cff0151af18a003424fad90a47375f3620201113204655",
    "state": "downloadable",
    "transfer_type": 4,
    "shortened_url": "https://we.tl/t-BUr6nd2DAP",
    "expires_at": "2020-11-20T20:47:07Z",
    "password_protected": false,
    "uploaded_at": "2020-11-13T20:47:07Z",
    "expiry_in_seconds": 596443,
    "size": 497659,
    "deleted_at": null,
    "recipient_id": null,
    "display_name": "flower-3876195_960_720.jpg",
    "security_hash": "828b5e",
    "description": "Hi this is an upload from https://github.com/orgrimarr/node-wetransfert API",
    "items": [
      {
        "id": "579ed7dce3ea1b93a8dff0ee67c0b0e620201113204655",
        "name": "flower-3876195_960_720.jpg",
        "retries": 0,
        "size": 147377,
        "item_type": "file",
        "previewable": true,
        "content_identifier": "file"
      },
      {
        "id": "4d121cf7fb261b2fb2e728afa6a36b7520201113204655",
        "name": "gnu.txt",
        "retries": 0,
        "size": 34667,
        "item_type": "file",
        "previewable": false,
        "content_identifier": "file"
      }
    ],
    "sessionCookie": "_wt_session=UkJPUmNjZW5EeEpWejlya; domain=wetransfer.com; path=/; secure; HttpOnly; SameSite=Lax",
    "csrf": "+dM4tvhVEguYfovUU60pnkK01uaabujp1oAsm8iNe2sf4ZBDeke2cTRR6VNBPZeegSF4fzgKylX+zyeZQEtFeA=="
  },
  "downloadURI": "https://download.wetransfer.com//eu2/cff0151af18a003424fad..........."
}

Known Bugs

  • Upload
  • Login
// Juste add the begining of your script
process.env.DEBUG = "wetransfert*"