fist commit
This commit is contained in:
commit
a27fca4dea
17 changed files with 5033 additions and 0 deletions
3
docs/commands.md
Normal file
3
docs/commands.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Command Reference for docker-volume-manager
|
||||
|
||||
TODO: Add your command reference here
|
47
docs/plugins.md
Normal file
47
docs/plugins.md
Normal file
|
@ -0,0 +1,47 @@
|
|||
# Plugin guide for docker-volume-manager
|
||||
|
||||
Plugins allow you to add features to docker-volume-manager, such as commands and
|
||||
extensions to the `toolbox` object that provides the majority of the functionality
|
||||
used by docker-volume-manager.
|
||||
|
||||
Creating a docker-volume-manager plugin is easy. Just create a repo with two folders:
|
||||
|
||||
```
|
||||
commands/
|
||||
extensions/
|
||||
```
|
||||
|
||||
A command is a file that looks something like this:
|
||||
|
||||
```js
|
||||
// commands/foo.js
|
||||
|
||||
module.exports = {
|
||||
run: (toolbox) => {
|
||||
const { print, filesystem } = toolbox
|
||||
|
||||
const desktopDirectories = filesystem.subdirectories(`~/Desktop`)
|
||||
print.info(desktopDirectories)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
An extension lets you add additional features to the `toolbox`.
|
||||
|
||||
```js
|
||||
// extensions/bar-extension.js
|
||||
|
||||
module.exports = (toolbox) => {
|
||||
const { print } = toolbox
|
||||
|
||||
toolbox.bar = () => { print.info('Bar!') }
|
||||
}
|
||||
```
|
||||
|
||||
This is then accessible in your plugin's commands as `toolbox.bar`.
|
||||
|
||||
# Loading a plugin
|
||||
|
||||
To load a particular plugin (which has to start with `docker-volume-manager-*`),
|
||||
install it to your project using `npm install --save-dev docker-volume-manager-PLUGINNAME`,
|
||||
and docker-volume-manager will pick it up automatically.
|
Loading…
Add table
Add a link
Reference in a new issue