From bd30227f0186cf575be0a96bbe3cf2215ed591a0 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 7 Oct 2017 01:41:01 +0400 Subject: Add an example and navigation links --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/README.md b/README.md index 5fc2c20..fd6e25f 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,29 @@ Details in [the documentation](https://github.com/apocas/dockerode#pull-from-private-repos). ## API +
+
+ create(options)Promise +
+
+

Creates a container by options or name, returning the management interface.

+
+
+ get([id])Promise +
+
+

Returns the container management interface.

+
+
+ info([id])Promise +
+
+

Searches in existing containers.

+
+
+ + + ### create(options) ⇒ Promise Creates a container by options or name, returning the management interface. @@ -101,6 +124,8 @@ Creates a container by options or name, returning the management interface. | --- | --- | --- | | options | String \ Object | The name of the image or options | + + ### get([id]) ⇒ Promise Returns the container management interface. @@ -108,6 +133,19 @@ Returns the container management interface. | --- | --- | --- | | [id] | String | Container ID | +#### Examples: +```JavaScript +containers.get().then(containers => { + /* containers - All containers in the system */ +}); + +containers.get('5520e855dd2c301b23a718cf392f9619d1edc3dc0fa294559b725d7588ca807f').then(container => { + /* container - The specified container */ +}); +``` + + + ### info([id]) ⇒ Promise Searches in existing containers. @@ -115,6 +153,17 @@ Searches in existing containers. | --- | --- | --- | | [id] | String | Container ID | +#### Examples: +```JavaScript +containers.info().then(containers => { + /* containers - All containers in the system */ +}); + +containers.info('21ae4a54be582d13fffd796341b3561a8c8e0c59dd6c6c3239529188e2b3321d').then(container => { + /* container - The specified container */ +}); +``` + ## Debugging Use the `DEBUG` variable with the `containers` option. -- cgit v1.2.3