# Meteor-runtime **Repository Path**: mirrors_tanis2000/Meteor-runtime ## Basic Information - **Project Name**: Meteor-runtime - **Description**: Adds runtime bundler to Meteor - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-18 - **Last Updated**: 2026-02-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Runtime [![Build Status](https://travis-ci.org/raix/Meteor-runtime.png?branch=master)](https://travis-ci.org/raix/Meteor-runtime) [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RT7MRRYH39QTN) ============ This package add runtime dynamic bundling to Meteor, ##Usage The runtime packages can be created from packages or from an app `Runtime.package` Parametres: * `Assets` - Requires the current Assets object - this is scoped pr. app and package so the bundler needs to be passed a handle. It's used to load `js` and `css` assets into a runtime bundle. * `packageHandler` - Requires a function to get the wanted runtime bundle. * `where` - Optional, set the bundles where you want to allow use of the `packageHandler` - fallsback to "after" if not set. Example: ```js // Add file from assets Runtime.package(Assets, function(api) { // The api object: // api.query - The parent parametres can be passed on // api.userAgent // // If user added Andrew's useragent package then the following will be available: // api.browser // api.os { family, major, minor, patch} // api.device // // For adding file dependencies: // api.addFile(filename, [where]) // where is optional, if not set then included in all package bundles // 'before', 'after', 'lazy' or 'customName' (two last would require manual loading / lazyloading) //console.log(api.query.tester); api.addFile('test.js', 'before'); }, ['before', 'after']); ``` *If you install the `useragent` package by @awwx/Andrew this package will automaticly use it for parsing the `api.userAgent`* Another example: ```js // Set the platform `?platform=ios` on the Meteor remote url in cordova // and get served platform specific javascript Runtime.package(Assets, function(api) { if (api.query.platform === 'ios') { api.addFile('cordova.ios.js', 'after'); } if (api.query.platform === 'android') { api.addFile('cordova.android.js', 'after'); } }, ['after']); ``` *Maybe serve some specific css style layout pr. platform, the platform could be set to a more uniq value eg. `?token=iosXFd3dfsSXfD3dS` if sending api keys to cordova* Contributions are wellcome, Regz. RaiX, aka Morten