1.0.1 • Published 5 years ago

dx-oss-poster v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

安装

$ npm install dx-oss-poster

使用

const op = require('dx-oss-poster')
const oss={
    accessKeyId: 'xxx',
    accessKeySecret: 'xxx',
    region: 'oss-cn-shenzhen',
    bucket: 'bucket name'
}

const poster = new poster(oss, savePath: 'poster' });

const config = {
    background: "https://www.abc.com/background.jpg",
    element: [{
        type: "img",
        url: "https://www.abc.com/headimg.JPG",
        width: 100,
        height: 100,
        mode: 'fill',
        roundedCorners: 50,
        rotate: 0,
        x: 0,
        y: 0,
        position: "nw",
        voffset: 0
    }, {
        type: "text",
        fill: "ffffff",
        font: '文泉驿正黑',
        fontSize: 50,
        textShadow: 0,
        textRotate: 0,
        text: "这是一行文字",
        x: 0,
        y: 0,
        position: 'center',
        voffset: 500,

    }]
    
(async function(){
    let url=await op.makePoster(config)
})()
1.0.1

5 years ago

1.0.0

5 years ago