Negatory. Postpone Mission.

    qiniu-token
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.9 • Public • Published

    Qiniu-Token

    支持ts,无需请求服务器,即可本地生成七牛 upload token

    📦 Install

    npm i qiniu-token --save
    

    🔧 Configuration

    {
      bucket: string // 空间名
      accessKey: string // access key
      secretKey: string // secret key
      expire?: number // token过期时间,非必选,默认两小时
    }
    

    🔨 Usage

    import Token from 'qiniu-token'
    
    const myToken = new Token({
      //qiniu test account
      bucket: "qtestbucket",
      accessKey: "iN7NgwM31j4-BZacMjPrOQBs34UG1maYCAQmhdCV",
      secretKey: "6QTOr2Jg1gcZEWDQXKOGZh5PziC2MCV5KsntT70j"
    })
    
    console.log(myToken.getToken())
    
    // iN7NgwM31j4-BZacMjPrOQBs34UG1maYCAQmhdCV:Namtq5T989Dr2BBzjOYD5CqBMXA=:eyJzY29wZSI6InF0ZXN0YnVja2V0IiwiZGVhZGxpbmUiOjE2MTkwOTUwNTZ9
    var Token = require('qiniu-token').default
    
    var myToken = new Token({
      // ...
    })
    
    console.log(myToken.getToken())

    Install

    npm i qiniu-token

    DownloadsWeekly Downloads

    10

    Version

    1.0.9

    License

    ISC

    Unpacked Size

    6.76 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar