
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
api-binary-proxy
Advanced tools
Proxy to serve binaries such as images from an API that returns base64 encoded files inside a JSON structure.
Proxy to serve binaries such as images from an API that returns base64 encoded files inside a JSON structure.
Currently a proof of concept with the plan to address performance issues and export a route that can be mounted in a parent application.
apiBinaryProxy(config)
Returns a route handler that can be used by Express.
Where config is of the shape {apiUrl, propertyNames, assumeMimeType}:
apiUrl: The API url uses sprintf format (see below)propertyNames: An object of the shape {payload, extension, mime, filename}, containing property names that are expected in the upstream API. Each property will default to the property name if not supplied (i.e. payload defaults to "payload"):
payload: the base64 encoded fileextension: the file extension, this could be with or without an initial .mime: the mime type of the file if availablefilename: the full filename if availableassumeMimeType: the mime type to use if it can't be identified from the upstream API. If not set, will return 404 for unknown mime types.forwardHeaders: Whether to forward incoming headers to the upstream API. Defaults to false.forwardQueryString: Whether to forward query string to the upstream API. Defaults to true.const express = require('express')
const apiBinaryProxy = require('api-binary-proxy');
const app = express();
app.use('/files', apiBinaryProxy({
apiUrl: 'http://localhost:3001/api/%1$s',
propertyNames: {payload: 'image'},
assumeMimeType: 'image/jpeg',
forwardHeaders: true,
forwardQueryString: true
}));
In the example above, %1$s will be replaced by any path after '/files' (req.path).
The API url uses sprintf format, for more information see the sprintf-js readme. This is to enable further configuration options to be added in future and to support alternative uses such as:
npm i
npm run dev
Then browse to:
FAQs
Proxy to serve binaries such as images from an API that returns base64 encoded files inside a JSON structure.
The npm package api-binary-proxy receives a total of 1 weekly downloads. As such, api-binary-proxy popularity was classified as not popular.
We found that api-binary-proxy 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
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.