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

quark2baidu

v2.0.1

Published

Cross-platform CLI for moving files from Quark Cloud Drive to Baidu Netdisk.

Readme

Q2B - Quark2Baidu

A careful cross-platform CLI for moving files from Quark Cloud Drive to Baidu Netdisk.

Q2B starts as a focused Quark -> Baidu transfer tool and is being shaped into a clean cloud-to-cloud migration project. It is designed for two audiences at once: non-developers who want a guided command, and developers who want a readable, testable codebase.

Project page · Issues · License

What It Does

  • Transfers selected files from Quark Cloud Drive to Baidu Netdisk.
  • Uses Baidu rapid upload first when the server-side cache can match the file.
  • Falls back to normal multipart upload when rapid upload misses, unless disabled.
  • Preserves folder structure when selecting folders recursively.
  • Stores cookies locally in the operating system user config directory.
  • Runs on Windows, macOS, and Linux with Node.js and npm.

Install

Install from npm:

npm install -g quark2baidu

You can also run from GitHub source:

git clone https://github.com/chang-xinhai/Quark2Baidu.git
cd Quark2Baidu
npm install
npm link
q2b doctor

Quick Start

  1. Save cookies and defaults:

    q2b setup
  2. Verify the local environment and current login state:

    q2b doctor --online
  3. Start the interactive transfer flow:

    q2b

The CLI will open a Quark file picker, let you select files or folders, then transfer to your configured Baidu target folder.

Getting Cookies

Q2B talks directly to Quark and Baidu from your machine, so it needs your browser cookies.

Recommended browser extension flow:

  1. Install Cookie-Editor for Chrome or Edge.
  2. Log in to Quark Cloud Drive and Baidu Netdisk.
  3. Open Cookie-Editor on each site.
  4. Export as Header String.
  5. Paste the full string into q2b setup.

Developer tools flow:

  1. Log in to the target website.
  2. Open DevTools, then the Network panel.
  3. Refresh the page.
  4. Select a list/sort request.
  5. Copy the full Cookie request header value.

Commands

q2b                     # choose files and start transfer
q2b transfer            # same as q2b
q2b setup               # save cookies and defaults
q2b doctor              # inspect local config
q2b doctor --online     # validate Quark and Baidu login state
q2b config path         # print active config file path
q2b config show         # print redacted config

Useful flags:

q2b --target /Q2B/Archive/
q2b --concurrency 5
q2b --no-fallback-upload
q2b --config ./local.config.json

Configuration

Default config locations:

  • macOS: ~/Library/Application Support/q2b/config.json
  • Windows: %APPDATA%\q2b\config.json
  • Linux: ~/.config/q2b/config.json

The config file is written with restrictive permissions where the operating system supports it.

Environment variable overrides:

Q2B_QUARK_COOKIE="..." Q2B_BAIDU_COOKIE="..." q2b doctor --online
Q2B_CONFIG=/path/to/config.json q2b
Q2B_DEBUG=1 q2b

Config shape:

{
  "quarkCookie": "",
  "baiduCookie": "",
  "targetPath": "/Q2B/",
  "concurrency": 3,
  "chunkSize": 262144,
  "fallbackUpload": true,
  "verifySsl": true
}

Safety Model

Q2B is local-first:

  • It does not run a hosted backend.
  • It does not collect telemetry.
  • It does not send cookies anywhere except Quark and Baidu requests made by your local process.
  • Diagnostic output redacts cookie values.
  • Remote paths are normalized and checked before upload requests.
  • Temporary fallback-upload files are deleted after each task.

Important limits:

  • Cookies are sensitive credentials. Treat them like passwords.
  • Baidu rapid upload depends on server-side file availability and can fail for normal reasons.
  • Fallback upload may download the source file to local temporary storage before uploading it to Baidu.
  • Platform APIs and web cookies can change without notice.

Developer Workflow

npm install
npm run check
npm test
node ./bin/q2b.js --help

Project layout:

bin/q2b.js              npm executable entry
src/cli.js              command routing
src/transfer.js         interactive picker and transfer orchestration
src/clients/quark.js    Quark API client
src/clients/baidu.js    Baidu API client
src/config.js           config loading, saving, redaction
src/paths.js            remote path validation helpers
docs/                   GitHub Pages product site
Q2B.py                  legacy Python implementation

Legacy Python Entry

The original Python script is still kept for users who already rely on it:

pip install httpx prompt_toolkit tqdm
python Q2B.py

New development should target the npm CLI unless a change specifically concerns the legacy Python path.

Roadmap

  • Current: stable Quark -> Baidu CLI with recursive selection and fallback upload.
  • Next: resumable transfer state, richer retry policy, and structured transfer reports.
  • Later: provider adapter interfaces for more netdisks.
  • Long term: migration between any two supported cloud drives.

Disclaimer

This project is for personal data migration, learning, and interoperability experiments. Use it only with files and accounts you are allowed to operate. Follow Quark, Baidu, and local law/service terms. You are responsible for account, data, and copyright risk.

License

MIT. See LICENSE.