{"id":20428909,"url":"https://github.com/ppmathis/fusion.io","last_synced_at":"2025-07-28T11:02:20.206Z","repository":{"id":10628009,"uuid":"12850974","full_name":"ppmathis/fusion.io","owner":"ppmathis","description":"Fast and lightweight plugin system - everything's a plugin™","archived":false,"fork":false,"pushed_at":"2013-10-10T22:50:26.000Z","size":180,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-03T12:58:51.818Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"OfficeDev/office-ui-fabric-react","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppmathis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-15T19:17:06.000Z","updated_at":"2015-05-17T18:37:57.000Z","dependencies_parsed_at":"2022-09-26T17:41:30.718Z","dependency_job_id":null,"html_url":"https://github.com/ppmathis/fusion.io","commit_stats":null,"previous_names":["neoxid/fusion.io"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ppmathis/fusion.io","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmathis%2Ffusion.io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmathis%2Ffusion.io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmathis%2Ffusion.io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmathis%2Ffusion.io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppmathis","download_url":"https://codeload.github.com/ppmathis/fusion.io/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmathis%2Ffusion.io/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267505080,"owners_count":24098345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T07:29:24.876Z","updated_at":"2025-07-28T11:02:20.158Z","avatar_url":"https://github.com/ppmathis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fusion.io #\n\n[![build status](https://secure.travis-ci.org/NeoXiD/fusion.io.png)](http://travis-ci.org/NeoXiD/fusion.io)\n\nfusion.io is fast and lightweight plugin system for Node.js applications. This module\nfollows the philosophy *everything's a plugin™*, which effectively means that your whole\napplication is just built on top of a bunch of plugins. They can interact and rely on each other,\nwithout worrying about dependency resolving \u0026 injection.\n\n## How it works ##\nAs mentioned above, the principle of fusion.io is that your whole application\nis built on top of some plugins. Worried about dependency resolving \u0026 injection?\nfusion.io handles these things for you!\n\n## License \u0026 Requirements ##\nGPL v3 - Please see LICENSE for more information.\nNo requirements except Node.js \u003e= 0.6.x\n\n## Application skeleton ##\n### app.js ###\nThis is your main application file, which should be named *app,js*. Usually it should only\ncontain around 5 lines, thanks to fusion.io:\n```js\nvar FusionIO = require('fusion.io');\nvar app = new FusionIO();\napp.setRootPath(__dirname);     // Specifies where the 'plugins' folder is located, usually __dirname is correct\napp.loadConfig('config.js');\napp.createApp();\n```\n\n### config.js ###\nThis file contains all active plugins and their configuration, if necessary.\nIt should be loaded by *loadConfig* before creating the application. Currently, multiple configurations\ncan *NOT* be merged together. Example configuration:\n```js\nvar exports = module.exports = [\n  // How to require a plugin without any options\n  {\n    pluginName: 'fusion-blog.db'\n  },\n  \n  // Shortcut to require plugins without any options\n  'fusion-blog.model',\n  \n  // Require a plugin with some options\n  {\n    pluginName: 'fusion-blog.http',\n    port: 8080\n  }\n];\n```\n\n### plugins/ ###\nThis is your plugin folder - each plugin should have its own folder within the *plugins* folder.\nTo prevent duplicates, you should prefix your plugins with the project name, your vendor name or anything you like.\nRemember, you *must* specify the plugin name later on for dependency injection, so it shouldn't be too long.\n\n**Example:** *fusion-blog.db* - *fusion-blog* is the product name, and *db* the plugin name.\n\n## Plugin skeleton ##\n### package.json ###\nEvery fusion.io plugin *needs* a package.json. It has two advances: First, you can easily use npm with your plugins.\nSecond, all the required plugin dependencies and exports can be easily specified and changed. You interchanged\na logging plugin with another one? Just edit the package.json to point to the new plugin. Example:\n```js\n{\n    \"name\": \"fusion-example.kitten-demo\",   // Optional metadata, can be used with NPM\n    \"version\": \"1.0.0\",     // Should always be specified! Otherwise fusion.io will log a warning.\n    \"main\": \"kitten.js\",    // Must point to the main plugin file\n    \"private\": true,        // Optional metadata, can be used with NPM\n\n    \"fusionio\": {\n        // Import 2 plugins, thats all you need to do...\n        \"imports\": [\n            \"fusion-blog.db\",\n            \"fusion-example.kitten-milk\"\n        ],\n        \n        // Export one plugin (hint: you can export more than just one plugin)\n        \"exports\": [\n          \"fusion-example.kitten\"\n        ]\n    }\n}\n```\n\n### kitten.js ###\nThis file can have any name, as long as it is specified in the *main* property of the *package.json* file.\nAs you might have guessed already, it represents your main plugin file, which should be built like this:\n\n```js\n/**\n * This method gets called by the fusion.io core. There will always be exactly 3 arguments provided.\n * {options} is an object which contains all configuration values (which where specified in the application config)\n * {imports} This is a function which returns any import specified in package.json. If the import does not\n              exist, an error will be thrown. Signature: function(pluginName)\n * {exports} This is a function with the signature: function(err, exports).\n *            If an error occured while initializing the plugin, pass the error to err.\n *            If everything went fine, pass an object containing the plugins to export.\n * {fusion}  Optional parameter, contains an object with some functions to control FusionIO. Currently, only\n *            the function 'fetchPluginList' is supported, which will return a list of all plugins with their versions.\n */\nfunction FusionPlugin(options, imports, exports, fusion) {\n  var $db = imports('fusion-blog.db');\n  var $milk = imports('fusion-example.kitten-milk');\n  \n  exports(null, {\n    'fusion-example.kitten': {\n      meow: function(hello, world) {\n        return $milk.mixWithChocolate($db.fetchMilk());\n      }\n    }\n  });\n\n  console.log('This cute example is powered by these plugins: ');\n  console.log(fusion.fetchPluginList());\n}\n\n// Exports the plugin\nvar exports = module.exports = FusionPlugin;\n```\n\n- - -\nfusion.io plugin system - © 2013 Pascal Mathis \u003cdev@snapserv.net\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppmathis%2Ffusion.io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppmathis%2Ffusion.io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppmathis%2Ffusion.io/lists"}