![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.
callbackmaybe
Advanced tools
I just met you / and this is crazy / but here's my module / CallbackMaybe
A module that makes it easy to support both event emitters and callbacks in your node.js API methods.
var CallbackMaybe = require('callbackmaybe');
YourModule.prototype.someMethod(callback) {
var cbm = new CallbackMaybe(callback, options);
anEmittingFunction().on('foo', function(foo) {
cbm.write('Do something with ' + foo);
}).on('end', function() {
cbm.end();
}).on('error', function(err) {
cbm.error(err);
});
return(cbm);
}
In the above example, if someMethod
is passed a callback, the callback will be invoked with an array of the items written via cbm.write()
. The callback will be invoked with an error if cbm.error()
is called.
With or without a callback, an EventEmitter is returned which will emit a data
event for each item written and an end
event with a count of items emitted. An error
event is emitted if cbm.error()
is called.
A method implemented as above will support the following access methods:
yourModule.someMethod(function(err, results) {
// an array of results or an error
});
yourModule.someMethod().on('data', function(data) {
// each result, one at a time
});
yourModule.someMethod().on('end', function(count) {
// An easy way to get a count of results
});
Currently only one option
is supported:
write
after the limit is reached will return false
.npm install callbackmaybe
This library has no production dependencies, only the following test dependencies:
FAQs
I just met you / and this is crazy / but here's a module / CallbackMaybe
We found that callbackmaybe 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.