Library / SDK
qiniu/nodejs-sdk avatar
qiniu/nodejs-sdk

The Qiniu Node SDK wraps a Chinese object storage API in JavaScript

Qiniu Resource (Cloud) Storage SDK for Node.js

590 stars191 forksJavaScriptLicense varies

At a glance

What is it?
The qiniu package is the Node.js SDK for Qiniu cloud storage, with upload tokens, resumable uploads, CDN management and batch resource operations, and a set of example scripts that double as the API reference. It also exposes a sandbox mode with its own configuration, and it still declares support for Node 6.
Who is it for?
qiniu earns its place for a Node application that stores objects in Qiniu, since the example scripts cover the operations people actually need, from upload token creation to refresh and prefetch of CDN URLs to batch changes on a bucket, and the TypeScript declarations mean the wrapper is usable from a typed codebase.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 10 days ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A vendor SDK with three documented ways to get it

The qiniu package is described as a Node wrapper for the Qiniu resource, or cloud, storage API, and the readme is short because the interesting content is elsewhere. It names three installation routes. The recommended one is the npm registry, with a single install command.

bash
$ npm install qiniu

The second is a release download from the GitHub releases page, and the readme is explicit about why that route exists: the release artefacts carry version numbers, there is a changelog, and the usage specification is comparatively stable there, and older SDK versions can be obtained. The third is a clone of the git repository, with a warning that code on branches other than master may change and should be used with care. That last warning is the standard one, but it is worth taking seriously in a package whose release history extends back to version 7.15.x on npm and whose tags go back further. The documentation the readme points at is hosted separately as the Qiniu cloud storage Node.js SDK guide, and the readme is careful to say that the full usage information lives there.

The examples directory is the API reference

The repository carries a large examples directory, and its file names are more informative than any prose summary could be. On the object side there are scripts for creating an upload token, a simple form upload, a form upload with the private Qiniu upload host variant, a resumable upload, a proxy configuration for HTTP and HTTPS, an object lifecycle script and a prefetch operation. On the CDN side there are scripts to create a timestamp based anti-leech URL, to fetch bandwidth data and flux data, to list logs, to prefetch URLs and to refresh URLs and directories. And there is a long run of batch resource operations, covering change type, change MIME, change modification time, copy, move, delete, delete after a number of days, stat and bucket info, plus a script for checking the Qiniu authentication credentials. Each of those is a working snippet for one API call, and together they cover the surface a working application touches. If you are evaluating the SDK, reading that directory top to bottom is faster than any tutorial, because it shows the actual request shapes rather than an abstracted summary of them.

A sandbox mode with its own environment and its own test suite

The package scripts reveal a second, newer surface: a sandbox. There is a dedicated test script that runs a set of sandbox test files covering the client, the commands, the facade, the filesystem, git, the pseudo terminal and templates, and separate scripts for the default templates and for an integration test of the template listing, the latter requiring an API key through an environment variable. The environment example file for these runs is unusually well annotated, and it is worth reading as a description of what the sandbox can do. It takes an API key and an optional custom endpoint, an optional template alias or identifier that defaults to a base template, and a flag that opts in to creating and deleting a template in the example script. It also has variables for access and secret keys used by the injection rule and Kodo resource examples, a Git remote with a username and password, a GitHub token and a mount path for a Git repository resource, a bucket and mount path for a Kodo resource, tokens for HTTP request injection and for an OpenAI key, and a maximum retry count for sandbox creation and connection that defaults to five and can be set to zero to disable. The presence of a pseudo terminal test and of a request injection token tells you the sandbox is closer to an environment you can drive than a mock.

TypeScript types ship with the JavaScript

The package includes declaration files, with a top level index declaration and a separate declaration for a storage response interface, and the manifest points at the declaration file for the types entry. A dedicated script runs the TypeScript compiler in no emit mode as a type check, which means the declarations are validated in CI rather than being an aspiration, and a tsconfig file is in the tree. For an SDK that is mostly a thin wrapper over HTTP calls, typed declarations are the difference between a good developer experience and a pile of any types, and shipping them separately from the implementation is the usual pattern for a JavaScript package that is consumed from TypeScript. The example directory also includes a script for checking the Qiniu authentication, which is the first thing to run when a signature is rejected, since the signing scheme, with its access key, secret key and the content hash parameter, is where a first integration usually goes wrong.

Tests need a real environment, and the timeouts show it

The test command is a mocha run with a five minute timeout and three retries, which tells you the suite talks to a real service rather than to a stub, since a mock does not need either. The readme documents how to run a single area of the suite, by changing into the test directory, sourcing the environment script and passing a grep filter to mocha.

bash
$ cd ./test/
$ source test-env.sh
$ mocha --grep 'bucketinfo'

Coverage is handled with nyc, with a cover script that runs the tests under instrumentation and a report script that renders the HTML report, and the makefile wraps that pair along with a clean target that removes the coverage and nyc output directories. Linting is eslint, and there is an eslint configuration in the root along with a coverage configuration file. The presence of a test environment script rather than a fixture file tells you that the suite expects real credentials and a real bucket, which is normal for a storage SDK but does mean the tests are not something you can run in isolation without an account.

An engine floor of Node 6, and a licence question in the metadata

Two details in the manifest are worth flagging. The first is the engines field, which declares support for Node 6 and above, on a package whose current version is 7.15.5 and whose dependency list includes packages of the same vintage, with an HTTP agent keep-alive helper, a chunked stream library, a CRC32 implementation and an URL encoder. A floor that old is either a compatibility promise nobody tests or a number nobody has updated, and either way it tells you nothing about which Node versions the code actually runs on. The second is the licence, where the readme states MIT with the copyright held by qiniu.com and a link to the licence text, and the badge agrees, while the repository listing reports the licence as a custom one that GitHub cannot classify. For an MIT package published to npm that discrepancy is normally a file naming issue rather than a substantive one, but it is the kind of thing to confirm in the licence file before you vendor it into a product with a different policy. The project itself is a vendor SDK, and the release cadence reflects that, with 7.15.3 in June 2026, 7.15.4 in July and 7.15.5 later that month, and a push to the default branch as recently as 2026-10-13.

Editorial conclusion

qiniu earns its place for a Node application that stores objects in Qiniu, since the example scripts cover the operations people actually need, from upload token creation to refresh and prefetch of CDN URLs to batch changes on a bucket, and the TypeScript declarations mean the wrapper is usable from a typed codebase. It is the wrong choice if you are evaluating storage providers in general, since the interface is specific to one vendor's API, and the wrong choice if you are starting a new project on a modern Node version, because the package still declares an engine floor of Node 6 and a dependency set from that era. Verify three things before you adopt it: that the release you take is the one you want, since the repository recommends the npm route while the releases carry numbered versions with a changelog, that the credential handling in the example scripts matches your own policy, since the environment file for the sandbox examples shows the shape of the secrets involved, and whether the type definitions match the version of the API you are calling. The licence is MIT according to the readme and the licence file, the newest release is v7.15.5 from 2026-07-21, and the last push was on 2026-10-13.

Frequently asked questions

How do I install the Qiniu Node.js SDK?

The recommended way is npm install qiniu. The readme also offers release downloads from the GitHub releases page, where version numbers and a changelog are available and older versions can be found, and a git clone, with a warning that branches other than master may change.

What operations does the qiniu SDK cover?

The examples directory shows the surface: creating upload tokens, form and resumable uploads, HTTP and HTTPS proxy configuration, object lifecycle and prefetch operations, CDN bandwidth and flux data, log listing, prefetching and refreshing CDN URLs, and a large set of batch resource operations including change type, change MIME, copy, move, delete, delete after days, stat and bucket info.

How do I run the qiniu SDK tests?

The full suite is a mocha run with a five minute timeout and three retries, executed with npm test. The readme shows how to run a subset by changing into the test directory, sourcing the test environment script and passing a grep filter to mocha, and coverage is produced with nyc through the cover and report scripts.

Does the qiniu package ship TypeScript types?

Yes. The repository includes an index declaration and a separate declaration for the storage response interface, and the manifest points at the declaration file for the types entry. A check-type script runs the TypeScript compiler without emitting, so the declarations are validated in CI.

Official sources

  1. Issues
  2. qiniu/nodejs-sdk on GitHub
  3. README
  4. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/qiniu-nodejs-sdk.svg)](https://hysenlabs.com/projects/qiniu-nodejs-sdk)

Was this useful?