Package Exports
- yg-canvas
- yg-canvas/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (yg-canvas) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
installation
$ npm i yg-canvas
welcome
const yg-canvas = require("yg-canvas")
const fs = require("fs")
async function await() {
const welcome = await new yg-canvas.welcome()
.setProfile("https://raw.githubusercontent.com/squad-404/knights-canvas/main/assets/img/default-avatar.png")
.setName("yogi prasetya")
.setBg("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTLn5-nn4-7EOA0THMNo9yaRXKegd28AAZ86ZUWgnQC6Ew6b8nrYzXsJITC&s=10")
.setMember("3")
.toAttachment();
return welcome
}
await().then((data) => {
fs.writeFileSync('out.svg', data.toBuffer())
})
result
goodbye
const yg = require("yg-canvas")
const fs = require("fs")
//async await
async function await() {
const goodbye = await new yg.goodbye()
.setProfile("https://raw.githubusercontent.com/squad-404/knights-canvas/main/assets/img/default-avatar.png")
.setName("yogi prasetya")
.setBg("linkbg")
.setMember("3")
.startGoodbye();
return goodbye
}
//start && saving to svg
await().then((data) => {
fs.writeFileSync('out.svg', data.toBuffer())
})