Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
stianeikeland committed Aug 12, 2013
1 parent 8fbf5b5 commit 9a16f2d
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
# node-etcd

A work in progress nodejs library for [etcd](http://github.com/coreos/etcd)
A nodejs library for [etcd](http://github.com/coreos/etcd), written in coffee-script.

Only supports simple get, set, delete operations for now.
Travis-CI: [![Build Status](https://travis-ci.org/stianeikeland/node-etcd.png)](https://travis-ci.org/stianeikeland/node-etcd)

## Example

```coffeescript
# Example in coffee-script

EtcdClient = require 'node-etcd'

c = new EtcdClient
# Coffee-script examples:
Etcd = require 'node-etcd'
c = new Etcd

# Set a value
c.set "/key", "value", (err, val) ->
console.log err, val

# Get a value
c.get "/key", (err, val) ->
console.log err, val

# Delete a value
c.del "/key", (err, val) ->
console.log err, val

# Watch a value
c.watch "/key", (err, val) ->
console.log err, val

# Set with expiry (time to live)
c.setTTL "/key", "value", 5, (err, val) ->
console.log err, val

# Atomic setting (test and set)
c.setTest "/key", "new value", "old value", (err, val) ->
console.log err, val

# List machines in the etcd cluster
c.machines (err, val) ->
console.log err, val

# Get the leader of the cluster
c.leader (err, val) ->
console.log err, val

```

0 comments on commit 9a16f2d

Please sign in to comment.