cosis

1.0.0-bate.11 • Public • Published

COSIS release candidate


Cloud object storage integrate

  • Integrate Alibaba Cloud\Huawei Cloud\Tencent Cloud Object Storage to upload static files

Install


npm install cosis --save

//Create a file
cosis.config.json

API

//Get hash value 
hexGenerator()
//Get the cloud object storage access path asynchronous
sourceUrls(hex)
//start operation asynchronous
startOperations()

Example

let hex = hexGenerator(4)
startOperations(hex);
let srcs = sourceUrls()

Example Web Pack

const fs = require('fs');

const cosis = require('cosis');
let hex = cosis.hexGenerator(4)
cosis.sourceUrls(hex).then((res)=>{
    console.log(res)
})
class myPlugin {
    apply(compiler) {
        
        compiler.hooks.afterEmit.tapAsync(
            {
              name: 'MyPlugin',
              context: true,
            },
            (context, compiler, callback) => {
             
             cosis.startOperations(hex)
             
             callback()

            }   
          );
    }
}

configureWebpack = {
    plugins: [
            new myPlugin()
        ]
}
 

Command

npm run cosi:test

Use environment

Node.js

Acknowledgments to open source people and companies

Doc

./doc

License


COSI is available under the MIT license. COSI also includes external libraries that are available under a variety of licenses. See LICENSE for the full license text.

Readme

Keywords

none

Package Sidebar

Install

npm i cosis

Weekly Downloads

1

Version

1.0.0-bate.11

License

MIT

Unpacked Size

33.1 MB

Total Files

23

Last publish

Collaborators

  • south.orange