Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
ganomede-base-client
Advanced tools
Simple wrapper around restify.JsonClient
to
start with when writing own API Clients. Changes:
request()
-like method (#apiCall({method, path, body, headers, qs})
), meaning:
/api/v1
in front of all requests).Import BaseClient
and define higher-level APIs.
const BaseClient = require('ganomede-base-client');
class MyApi extends BaseClient {
constructor ({hostname = 'my-api.example.org', version = 1, apiKey}) {
super(
`https://${hostname}/version-${version}`, // base url
{headers: {'X-API-Key': apiKey}} // more options
);
}
ping (callback) {
// Will issue HTTP GET to
// https://my-api.example.org/version-1/ping?check-auth=1
//
// Callback will contain JSON response (if any, otherwise empty object),
// see restify docs for more details at:
// https://github.com/restify/clients
//
// `call` is what restify methods return (like #get(), #post(), etc.).
const call = this.apiCall(
{method: 'get', path: '/ping', qs: {'check-auth': 1}},
callback
);
}
}
Some defaults are changed from those of restify:
accept
of application/json
;accept-encoding
of gzip,deflate
.FAQs
Simple wrapper for restify.JsonClient
The npm package ganomede-base-client receives a total of 7 weekly downloads. As such, ganomede-base-client popularity was classified as not popular.
We found that ganomede-base-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.