@squarecloud/blob
Version:
Official Square Cloud Blob SDK for NodeJS
22 lines (15 loc) • 539 B
text/typescript
import { type CreateObjectType, MimeTypes } from "../src";
import { blob } from "./index.test";
// Create object using absolute path
const createWithPathPayload: CreateObjectType = {
file: "package.json",
name: "testing",
};
blob.objects.create(createWithPathPayload).then(console.log);
// Create object using buffer
const createWithBufferPayload: CreateObjectType = {
file: Buffer.from("content".repeat(1000)),
name: "testing",
mimeType: MimeTypes.TEXT_PLAIN,
};
blob.objects.create(createWithBufferPayload).then(console.log);