Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Brahma. Minimal and extremely opinionated offline logging and metrics solution.
While most of the projects we work on are online and can use Internet sometimes we encounter interesting offline projects for various expos, games etc. While offline these apps still need logging, metrics or analytics and this library aims to solve it.
Library designed to be non-configurable, drop-in solution, it suited my clients in the past, so I decided to share it. If you need configurable offline logging there are other solutions.
Brahma will create directory if it doesn't exist already and will fill it up
with csv
files as it goes, it will write them to a new line, but will lazily
create new csv
file every hour (only if it needs to write something).
To avoid keeping file stream opened for a long time. CSV format is fixed to
following columns:
// Import http, socket, logging etc.
import http from 'http';
import express from 'express';
import socketIo from 'socket.io';
import {metrics} from 'brahma';
// Initialise socket
const app = express();
const server = http.Server(app);
server.listen(7777);
const io = socketIo(server);
const metricsSocket = io.of('/metrics');
// Create meter function, that will do actual logging.
// Meter function will create new directory "metricsDirectory" and
// it will create new metrics file every ten minutes.
const meter = metrics('metricsDirectory');
metricsSocket.on('connection', (socket) => {
// Every time socket receives event "meter"
// it will log category, action and tags.
socket('meter', ({category, action, tags}) => meter(category, action, tags));
});
FAQs
Brahma. Minimal and extremely opinionated offline logging and metrics solution.
The npm package brahma receives a total of 3 weekly downloads. As such, brahma popularity was classified as not popular.
We found that brahma 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.