stc-cdn

1.0.13 • Public • Published

stc-cdn

Upload resource to cdn for stc

Install

npm install stc-cdn

How to use

// stc.config.js
 
var cdn = require('stc-cdn');
var cdnAdapter = require('stc-cdn-xxx');
 
stc.workflow({
  cdn: {plugin: cdn, options: {adapter: cdnAdapter}}
});

Adapter introduction

adapter code like this:

export default function stcAdapter(content, filepath, options, cacheInstance){
  let value = await cacheInstance.get();
  if(value !== undefined){
    return value;
  }
  value = await getCdnUrl(content);
  await cacheInstance.set(value);
  return value;
}

Adapter list

Readme

Keywords

none

Package Sidebar

Install

npm i stc-cdn

Weekly Downloads

2

Version

1.0.13

License

none

Unpacked Size

47.3 kB

Total Files

8

Last publish

Collaborators

  • welefen