1.4.0 • Published 9 months ago

@yingyeothon/s3-cache-bridge-client v1.4.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 months ago

S3 Cache Bridge Client

NodeJS Client library for S3 Cache Bridge.

Quick start

import S3cb from "@yingyeothon/s3-cache-bridge-client";

const cb = S3cb({
  apiUrl: "http://your-server-address/",
  apiId: "api-id",
  apiPassword: "api-password",
});

// Get a file.
await cb.get("hello");

// Put a new content into the file.
await cb.put("hello", "new content");

// Delete a file.
await cb.delete("hello");

Functions

NameDescriptionExample
getGet a file as string.cb.get(key)
getBufferGet a file as buffer.cb.getBuffer(key)
downloadDownload a file into local.cb.download(key, localPath)
putPut a content into the file.cb.put(key, body: string)
appendAppend a content into the file.cb.append(key, body: string)
delDelete a file.cb.del(key)
patchPatch a JSON file using json-mod.cb.patch(key, operation: JSON_MOD)
invalidateInvalidate a cache file in bridge server.cb.invalidate(key)
syncUpload a cache file into S3 right now.cb.sync(key)
lockAcquire a lock of key.cb.lock(key)
unlockRelease a lock of key.cb.unlock(key)

License

MIT

1.4.0

9 months ago

1.3.0

3 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago