1.0.0-bate.11 • Published 3 years ago

cosis v1.0.0-bate.11

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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.