![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Node.js API abstracter. Provides a simple way to implement and consume any API; github, twitter, etc. This project grow out of the patterns in the ajaxorg/node-github project. This projects lets a developer implement all or parts of other APIs without the need for more API specific packages.
Goals:
The following is a list of APIs available in in the APIS folder.
If you have an API file to add feel free to email or make a pull request.
To install this package use the following
npm install braque
or
npm install git@github.com:d1b1/node-braque.git#master
The following is an example of how to implement the github API using the sample route file.
Simple version using no Authentication.
var Braque = require('braque');
var github = new Braque({
version: '3.0.0',
routeFile: './apis/github-v3.0.0.json',
});
github.repos.get( { user: 'd1b1', 'node-braque' }, function(err, repo) {
if (err) return console.log(err);
console.log(repo);
});
With Username and Password Authentcation.
var Braque = require('braque');
var github = new Braque({
version: '3.0.0',
routeFile: './apis/github-v3.0.0.json',
});
github.authenticate({
type: "basic",
username: 'XXXXXXXXXX',
password: 'XXXXXXXXXX'
});
github.repos.get( { user: 'd1b1', 'node-braque' }, function(err, repo) {
if (err) return console.log(err);
console.log(repo);
});
The route file provides the glue for any API abstraction. It tells braque about the endpoint infomation, protocal validation requirements and finally the routes. The code attempts to make separate the API endpoint groups into local groups. It will camelCase all function calls.
For example 'pull-requests/get-all' becomes github.pullRequest.getAll();
This project grew out of the work on several other projects; node-ci and its implementations of the node-github project and the formagg.io API. I needed the ability to implement our API in client consumer applications. We needed to have a consistent authentication pattern, error handling and documentation. The node.js github API project provided the pattern. It provides a node developer with a simple pattern to use when there is a need to integrate github into an larger feature set. The node-ci server needed the ability to interact with specific portions of the github api. Once I started work on the formagg.io the github pattern was a logic place to start.
Thanks [ajaxorg]https://github.com/ajaxorg
FAQs
Abstracter for external APIs. (Github, Heroku etc). Provides a simple wrapper for external APIs. Still beta.
The npm package braque receives a total of 2 weekly downloads. As such, braque popularity was classified as not popular.
We found that braque demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.