2025.2 has been released!
Check it Out!
Bit
Bit Source CodeBug & Suggestion Tracker
2025.2
  • Bit
  • Docs
  • Bit Plugins
  • Bit Changelogs
  • Bit Hosted
2025.2
  • Welcome
  • Updating
  • Commands
  • FAQ
  • Install Plugins
  • Dev
    • Create Plugins
      • Commands
      • Events
      • Plugin Requirements
      • Functions
        • bit/plugins
          • .is_active(id, version)
          • .find(id)
          • .list()
          • .count()
        • bit/core
          • .log(type, "Plugin Name", force_console, "Log")
          • .find_emoji(unicode_emoji)
          • .add_intent(IntentGatewayBits)
          • .install_module(npm_package)
      • Run function on bot startup
      • Global Exports
      • Definable Intents
      • Definable Node Modules
      • plugin.json
      • update.json
      • Updating to Bit 2025.2
      • Updating to Bit 2025.1
      • Updating to Bit 2024.2
      • Updating to Bit 2024.1
  • Dev español
    • Bienvenido
    • Crear complementos
      • Comandos
      • Eventos
      • Requisitos del complemento
      • Funciones
        • bit/plugins
        • bit/core
          • .logs
      • Ejecutar función al iniciar el bot
Powered by GitBook
LogoLogo

Copyright 2018-2026 Lockyz Media

On this page

Was this helpful?

Edit on GitHub
  1. Dev
  2. Create Plugins

Global Exports

Last updated 1 month ago

Was this helpful?

Added in Bit 2025.2, plugins can now define global exports that can be run within other plugins.

All you need is an index.js file within your main plugin directory, and different functions within your module.exports.

Example

module.exports = {
    test_function: function test_function() {
        console.log("Test Works!!!!")
    }
}

This can then be imported and used according to the example below

const test_plugin = require("bit/plugin/test-plugin");

test_plugin.test_function();

// Outputs "Test Works!!!!"

This feature should be VERY useful for plugin developers who want to interact with other plugins.

WARNING: This feature is EXPERIMENTAL.

Please exercise caution when using this feature!