![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Little helper module for translating events into log messages.
Will perfectly work with NodeJS 4.0.0 and above.
'use strict';
const events = require( 'events' );
const event2log = require( 'event2log' );
// First we create a dummy instance. It might be anything emitting events.
// This is the instance you are willing to observe and log upon emitted events.
let instanceThrowingEvents = new events.EventEmitter();
// The translation table converts events into human-readable strings.
// The field name corresponds to an event name. The field itself accommodates a
// function that receives the event arguments and alway will return an array!
// The first argument of that array names a logging method and the following
// items will be passed to logging method as arguments.
const translationTable = {
'event1': ( a, b ) => [ 'log', `Hello ${a}! Are you afraid of ${b}?` ],
'event2': ( c ) => [ 'error', `${c} is watching you!` ]
};
// The following statement bundles everything together. For testing purposes it
// just prints stuff to the console. But you also could replace the 'console' by
// something more sophisticated (or bloated?) like 'winston'.
let e2lHandler = event2log( translationTable, instanceThrowingEvents, console );
instanceThrowingEvents.emit( 'event1', "World", "Chuck Norris" );
// Will print to stdout: Hello World! Are you afraid of Chuck Norris?
instanceThrowingEvents.emit( 'event2', "Big Brother" );
// Will print to stderr: Big Brother is watching you!
// Calling the returned e2lHandler releases all listening events bound by
// event2log.
e2lHandler();
instanceThrowingEvents.emit( 'event1', "Universe", "human beings" );
// Won't print anything to the console.
FAQs
Translates events to human-readable log
The npm package event2log receives a total of 1 weekly downloads. As such, event2log popularity was classified as not popular.
We found that event2log 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
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.
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.