基于node.js的网盘sdk,现已支持小飞机网盘/蓝奏云优享
- 安装依赖
npm install @netdrive-sdk/ilanzou
- 初始化
const { FeiJiPanClient, FileTokenStore, LanZouYClient, logger } = require('@netdrive-sdk/ilanzou')
// 设置日志输出
logger.configure({
fileOutput: true,
isDebugEnabled: true
})
// 使用账号密码初始化, 并且存储token
// 飞机盘
const feijiPanClient = new FeiJiPanClient({
username: 'username',
password: 'password',
tokenStore: new FileTokenStore('token/feijipan_username.token')
})
// 蓝奏云优享
const lanZouYClient = new LanZouYClient({
username: 'username',
password: 'password',
tokenStore: new FileTokenStore('token/lanzouy_username.token')
})