Plugins
============

A simple plugin loading system. Currently the system is under heavy development
and the APIs can change at any time!

# Plugins

A simple plugin loading system.

A plugin system allows you to extend functionality of your system. Other
developers can hook into your APIs through the plugins library and interact
with each other at ease.

### Example
Initializing the loader is very simple
```dart
import 'package:plugins/loader.dart';

void main() {
  PluginManager pm = new PluginManager();
  Directory path = new Directory("plugins");
  pm.loadAll(path).then((_) {
    pm.listenAll((name, data) {
      print("Received data from plugin '$name': ${data[0]}");
      pm.killAll();
    });
    Map m = new Map();
    m[0] = "Hello from loader!";
    pm.sendAll(m);
  });
}
```
The plugins folder will look something like:
```
.
+-- test
|   +-- main.dart
|   +-- pubspec.yaml
|   +-- lib/
|   +-- packages/
```
Your lib folder can contain more code as needed for functionality. Dependencies
will work the same as usual for plugins. The pubspec.yaml file must contain, at
a minimum, the name.

Creating a plugin for a loader is just as simple as creating a loader.
```dart
import 'package:plugins/plugin.dart';
import 'dart:isolate';

void main(List<String> args, SendPort port) {
  Receiver rec = new Receiver(port);
  rec.listen((Map<dynamic, dynamic> data) {
    print("Received data in plugin: ${data[0]}");

    Map info = new Map();
    info[0] = "Hello from plugin!";
    rec.send(info);
  });
}
```

Visit the documentation for more information about the APIs.
Open an [issue](https://github.com/samrg472/plugins.dart/issues) for any
problems or suggestions.

Add examples to the readme and a better description
Add examples to the readme and a better description