@written/mkctx
TypeScript icon, indicating that this package has built-in type declarations

0.3.18 • Public • Published

Written Logo

@written/mkctx

Generate Appwrite Context Objects. Useful for testing & making non-appwrite-runner calls to appwrite functions.

See also: @written/httpcompat

Codeberg License

Installation

pnpm i @written/mkctx

Usage

The ctx constructor takes the same args as fetch().
Example:

import Ctx from '@written/mkctx';
const ctx = new Ctx('https://example.com/test', {
  method: 'POST',
});

// ...

(async () => {
  const response = await import('./someAppwriteFunc').default(ctx);
  // todo: handle response
})();

Obtaining Logs

You can use Ctx.getLogs(ctx)/Ctx.getErrors(ctx) to get the logs from the context object.

Readme

Keywords

none

Package Sidebar

Install

npm i @written/mkctx

Weekly Downloads

0

Version

0.3.18

License

MIT

Unpacked Size

33.6 kB

Total Files

16

Last publish

Collaborators

  • exponentialworkload