![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.
The base of a core object. Create an object implementing a plugin system, a stack handler and an event emitter + some useful methods for a core object.
Create an object implementing:
core-stack was implemented with performance and lightness in mind.
npm install core-stack
or with Yarn:
yarn add core-stack
See the source code for the JS doc.
import CoreStack from 'core-stack';
// or const CoreStack = require('core-stack');
const core = new CoreStack();
// adds what do you need in the `core`...
core.foo = {};
core.bar = 'bar';
export default core;
// or module.exports = core;
/**
* My plugin
*
* @param {CoreStack} core
* @param {*} [args]
* @param {function} done
*/
export default function myPlugin(core, args, done) {
// add some feature to the core
// ...
// `done` function indicate that the plugin is loaded
done(args);
};
On the fly:
core.use(plugin, pluginArgs, function(done /*, doneArgs */) {
console.log('plugin loaded!');
done(/* doneArgs */);
});
or a reusable plugin:
import myPlugin from './plug/myPlugin';
core.use(myPlugin);
// or core.use(require('./plug/myPlugin'));
Example, create a simple logger plugin (reusable):
export default function loggerPlugin(core, args, done) {
core.log = function() {
console.log(...arguments);
};
core.logWarn = function() {
console.warn(...arguments);
};
core.logError = function() {
console.error(...arguments);
};
done();
};
Load and use the logger plugin:
import logger from './plug/logger';
// load the logger plugin
core.use(logger);
// use the logger plugin when the core was booted
core.boot(function() {
core.log('Hello');
core.logWarn('Warning!');
core.logError('Ooops! An error occurred.');
})
import CoreStack from 'core-stack';
// Plugins
import logger from './plug/logger/';
import config from './plug/config/';
import router from './plug/router/';
import react from './plug/react/'; // or another lib / framework to initialize
const app = new CoreStack();
app
.use(logger)
.use(config)
.use(router)
.use(react)
.boot(function() {
app.log('all plugins are loaded');
// you can emit any events with the builtin event emitter
// see evemit package
app.emit('app.booted');
// init the routes and a router (e.g: routux package)
router.init();
})
;
MIT (c) 2016, Nicolas Tallefourtane.
Nicolas Talle |
FAQs
The base of a core object. Create an object implementing a plugin system, a stack handler and an event emitter + some useful methods for a core object.
We found that core-stack 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.