https://github.com/runnable/swarmerode
https://github.com/runnable/swarmerode
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/runnable/swarmerode
- Owner: Runnable
- Created: 2016-01-20T21:28:37.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-31T21:44:20.000Z (about 9 years ago)
- Last Synced: 2025-04-11T19:55:16.620Z (about 1 year ago)
- Language: JavaScript
- Size: 58.6 KB
- Stars: 4
- Watchers: 9
- Forks: 1
- Open Issues: 38
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# swarmerode
[](https://travis-ci.org/Runnable/swarmerode)
[](https://coveralls.io/github/Runnable/swarmerode)
[](https://david-dm.org/Runnable/swarmerode)
[](https://david-dm.org/Runnable/swarmerode#info=devDependencies)
[](http://standardjs.com/)
Swarmerode is a tool to extend [`dockerode`](https://www.npmjs.com/package/dockerode) with nice swarm helper functions.
## Example
```javascript
var Swarmerode = require('swarmerode')
var Dockerode = require('dockerode')
// extend Dockerode w/ Swarm functions.
Dockerode = Swarmerode(Dockerode)
var swarmClient = new Dockerode(/* opts */)
swarmClient.swarmHostExists('10.0.0.1:2375', function (err, hostExists) {
if (err) { throw err }
console.log(
hostExists
? 'The given host exists!'
: 'The given host was not found.'
)
})
```