本API是baidupcsapi的NodeJS移植版
$ npm install --save baidupanapi
一下所有的例子皆使用TypeScript
import PCS, * as bdapi from "baidupanapi"
let pcs = new PCS(bdapi.create_username_password_jar_creator("username", "password"))
pcs.init.then(() => {
//DO SOMETHINE HERE
}).catch(console.error)
import PCS, * as bdapi from "baidupanapi"
let pcs = new PCS(bdapi.create_username_password_jar_creator("username", "password"))
pcs.init
.then(() => pcs.quota()).then(console.log)
.then(() => pcs.list_files("/")).then(console.log)
.then(() => pcs.username()).then(console.log)
.catch(console.error)