@orama/cloudflare-api
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

Cloudflare API library

Nodejs

This library is a wrapper around the Cloudflare API.

Installation

npm install @orama/cloudflare-api

Usage

import { CloudflareApi } from '@orama/cloudflare-api';

const apiKey = 'your-api-key'
const api = new CloudflareApi({ apiKey })

// Worker KV
const ACCOUNT_ID = 'your-account-id'
const NAMESPACE_ID = 'your-namespace-id'
const workerKv = api.workerKv(ACCOUNT_ID, NAMESPACE_ID)

await workerKv.uploadKv('key', 'value') // upload a value to the KV
await workerKv.getKv('key', 'text') // return the text representation of the value
await workerKv.deleteKv('key') // delete the value from the KV

License

Apache-2.0

Readme

Keywords

Package Sidebar

Install

npm i @orama/cloudflare-api

Weekly Downloads

5

Version

0.2.1

License

Apache-2.0

Unpacked Size

42.6 kB

Total Files

19

Last publish

Collaborators

  • matijagaspar
  • niltonheck
  • rjborba-askorama
  • faustoq
  • fra.giannino
  • raiindev
  • allevo
  • micheleriva