Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@copicake/copicake-js
Advanced tools
🍰 Copicake, a data-driven image generating service to let you generate any social media material with just ONE CLICK.
npm install --save @copicake/copicake-js
yarn add @copicake/copicake-js
You need to initialize to get copicake instance first :
import Copicake from "@copicake/copicake-js";
const copicake = new Copicake({
apiKey: "your-api-key",
});
Object
)copicake.image
.create({
template_id: "YOU_TEMPLATE_ID",
changes: [
{ name: "text-9so09m", text: "hello world", fill: "#ff0000" },
{ name: "image-yeavh7", src: "https://your_website.com/test.png" },
],
options: {
webhook_url: "https://your_website.com/webhook_url",
},
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
string
)const renderingId = `YOUR_RENDERING_ID`;
copicake.image
.get(renderingId)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
string
)Sometimes you may notice that your image is still under processing
state, this is because the image is still being processed in the background by our servers.
In this way, we provide another handy method called getUntilFinished()
to get the image until the image is ready.
Internally, this is just a wrapper of get()
method with built-in retry mechanism. If after MAX_RETRY_TIMES
and the image is still under processing
state, we will throw an error (500) to let you know.
const renderingId = `YOUR_RENDERING_ID`;
copicake.image
.getUntilFinished(renderingId)
.then((response) => {
if (response.status === "success") {
// do something
} else if (response.status === "failed") {
// do something
}
})
.catch((error) => {
console.error(error);
});
File | Buffer
, type: "png" | "gif" | "jpg" | "jpeg"
)If you don't have a server to host images, we provided a handy way to let you upload a temporary image to our s3 and you can use the returned URL for later use.
P.S. Every temporary image will be removed within 1 day to avoid abuse
copicake.utils
.uploadTempImage(file, "png")
.then((result) => {
// result === https://s3.ap-northeast-1.amazonaws.com/copicake/temp/ak0zixy6rewsh6vaamzi.png
console.log(result);
})
.catch((error) => {
console.log(error);
});
FAQs
Copicake JS Library
We found that @copicake/copicake-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.