diff options
| author | Igor Pashev <pashev.igor@gmail.com> | 2012-04-24 21:41:52 +0400 |
|---|---|---|
| committer | Igor Pashev <pashev.igor@gmail.com> | 2012-04-24 21:41:52 +0400 |
| commit | 70b291ce61935fcdb916059c89bba5df500ec14e (patch) | |
| tree | 4e91ec1d521a4529cec9d530787f36957217e3af /examples | |
| parent | b72eeb00ec591c646c44cceddd3781a0b6e065e5 (diff) | |
| download | node-augeas-70b291ce61935fcdb916059c89bba5df500ec14e.tar.gz | |
Added async code that creates augeas object and execute callback function when ready
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/heracles.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/heracles.js b/examples/heracles.js new file mode 100644 index 0000000..2df4e67 --- /dev/null +++ b/examples/heracles.js @@ -0,0 +1,12 @@ +var aug = require('../build/Release/libaugeas'); +var heracles = aug.heracles; + +heracles(function(aug) { + if (!aug.error()) { + console.log(aug.get('/files/etc/hosts/1/ipaddr')); + } else { + console.log('Sad, but true :-('); + } + } +); +console.log('Waiting for Heracles :-)'); |
