Registry / devops / cloudly-rest

cloudly-rest

JSON →
library0.1.6jsnpmunverified

cloudly-rest is a generic REST client library designed for specialization in TypeScript projects. Version 0.1.6 provides a foundational set of utilities for making HTTP requests with typed responses and error handling. It is part of the Utily ecosystem and ships with TypeScript types. The library focuses on being lightweight and extensible, allowing developers to build specialized client wrappers around a generic core. Release cadence is not well-established; this is an early-stage package.

npm install cloudly-rest
INSTALL
IMPORT
SIG · CLOUDLY-REST
C
cloudly-rest
devopsjavascriptv0.1.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RestClient
import { RestClient } from 'cloudly-rest'
const RestClient = require('cloudly-rest')
ESM-only package; named export
restClient
import { restClient } from 'cloudly-rest'
import restClient from 'cloudly-rest'
Named export, not default
HttpRequest
import { HttpRequest } from 'cloudly-rest'
import { HttpRequest } from 'cloudly-http'
Re-exported from cloudly-http; available in this package for convenience

Create a REST client instance and make a GET request with authentication.

import { RestClient } from 'cloudly-rest'; import { HttpMethod } from 'cloudly-http'; const client = new RestClient({ base: 'https://api.example.com' }); const response = await client.request({ uri: '/users', method: HttpMethod.GET, body: undefined, headers: { Authorization: `Bearer ${process.env.API_KEY ?? ''}` } }); console.log(response.status);
Debug
Known issues
gotchaRestClient constructor requires base in options, but base URL must not have trailing slash.
fix
Use base without trailing slash, e.g., 'https://api.example.com'.
affects: >=0.0.1
gotchaThe library is early-stage (v0.1.6) and API may change without notice.
fix
Pin exact version and expect breaking changes.
affects: <1.0.0
deprecatedHttpMethod enum is deprecated in favor of string literal unions.
fix
Use 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' instead.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'cloudly-rest' or its corresponding type declarations.
TypeScript strict mode may require skipLibCheck or explicit type declarations.
fix
Ensure 'cloudly-rest' is installed and in tsconfig 'node_modules' resolution. If using pnpm, add to 'dependencies'.
TypeError: client.request is not a function
RestClient instance not properly initialized or import mistake.
fix
Use 'new RestClient(...)' (constructor) not 'RestClient(...)' (without new).
Error: Invalid base URL: must not have trailing slash
Base URL provided with trailing slash.
fix
Remove trailing slash from base URL.
Upgrade
Version history
0.1.6latest on npm
Audit
Dependencies
cloudly-httprequiredUsed for HTTP request/response handling
Agent activity
6 hits · last 30 days
node
6
Resources
cloudly-rest — npm install cloudly-rest · libregistry