Comparing version 0.0.5 to 0.0.6
@@ -6,3 +6,3 @@ { | ||
"keywords": ["output", "notify", "notification"], | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"homepage": "https://github.com/6/putt", | ||
@@ -9,0 +9,0 @@ "repository": { |
**putt** is a node.js module that lets you easily output text in lots of fun ways. It wraps a bunch of other libraries to make this as simple as possible. | ||
var putt = require('putt'); | ||
putt().speak("This is spoken aloud by your computer"); | ||
putt().desktop_notify("This appears as a desktop notification"); | ||
```javascript | ||
var putt = require("putt"); | ||
putt().speak("This is spoken aloud by your computer"); | ||
putt().desktop_notify("This appears as a desktop notification"); | ||
``` | ||
@@ -33,3 +35,5 @@ Supported output formats: | ||
putt().speak("I am talking", {voice: "Bruce"}); | ||
```javascript | ||
putt().speak("I am talking", {voice: "Bruce"}); | ||
``` | ||
@@ -43,17 +47,23 @@ All output types also have two optional callbacks that can be chained: | ||
putt().speak("I am talking").done(function() { | ||
console.log("Finished talking"); | ||
}).error(function(reason) { | ||
console.log("Something went wrong:", reason); | ||
}); | ||
```javascript | ||
putt().speak("I am talking").done(function() { | ||
console.log("Finished talking"); | ||
}).error(function(reason) { | ||
console.log("Something went wrong:", reason); | ||
}); | ||
``` | ||
Note that you can chain these method calls in any order: | ||
putt().done(function() { | ||
console.log("Finished talking"); | ||
}).speak("I am talking"); | ||
```javascript | ||
putt().done(function() { | ||
console.log("Finished talking"); | ||
}).speak("I am talking"); | ||
``` | ||
## Speech | ||
putt().speak("This is spoken"); | ||
```javascript | ||
putt().speak("This is spoken"); | ||
``` | ||
@@ -68,3 +78,5 @@ Options: | ||
putt().desktop_notify("This is a desktop notification"); | ||
```javascript | ||
putt().desktop_notify("This is a desktop notification"); | ||
``` | ||
@@ -83,3 +95,5 @@ Options: | ||
putt().post({param1: value1, param2: value2}, {url: 'http://example.com/whatever'}); | ||
```javascript | ||
putt().post({param1: "value1", param2: "value2"}, {url: 'http://example.com/whatever'}); | ||
``` | ||
@@ -95,4 +109,21 @@ Options: | ||
TODO | ||
By default, email assumes that the sender is a Gmail user. | ||
```javascript | ||
putt({ | ||
user: 'sender@gmail.com', | ||
pass: 'sender_password' | ||
}).email("Body of email", {to: 'recipient@example.com', subject: 'yo'}); | ||
``` | ||
Options: | ||
* `to` (required) the recipient email address | ||
* `subject` the subject for the email | ||
* `host` the SMTP host | ||
* `port` (integer) the SMTP port | ||
* `ssl` (boolean) whether or not to use SSL | ||
[See nodemailer docs](https://github.com/andris9/nodemailer) for more details | ||
## Tweet | ||
@@ -104,7 +135,9 @@ | ||
putt({ | ||
consumer_key: "your consumer key", | ||
consumer_secret: "your consumer secret", | ||
access_token: "your access token", | ||
access_token_secret: "your access token secret" | ||
}).tweet("This text will be tweeted by your account"); | ||
```javascript | ||
putt({ | ||
consumer_key: "your consumer key", | ||
consumer_secret: "your consumer secret", | ||
access_token: "your access token", | ||
access_token_secret: "your access token secret" | ||
}).tweet("This text will be tweeted by your account"); | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
10220
138