Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

putt

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

putt - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

package.json

@@ -5,3 +5,3 @@ {

"description": "easily output text in lots of fun ways (speech, growl, email, ...)",
"version": "0.0.3",
"version": "0.0.4",
"homepage": "https://github.com/6/putt",

@@ -8,0 +8,0 @@ "repository": {

@@ -12,36 +12,84 @@ **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.

* POST request (by [restler](https://github.com/danwrong/restler))
* TODO: Email (by [nodemailer](https://github.com/andris9/nodemailer))
* More coming soon... (SMS/call - twilio API, twitter/fb, ???)
* Email (by [nodemailer](https://github.com/andris9/nodemailer))
* Tweet (by [ntwitter](https://github.com/AvianFlu/ntwitter))
* More coming soon... (SMS/call - twilio API, ???)
# Install
First, install [Node.JS](http://nodejs.org/) and [NPM](http://npmjs.org/) if you haven't already. Then, just `cd` into your project folder and run:
First, install [Node.JS](http://nodejs.org/) and [NPM](http://npmjs.org/). Then, `cd` into your project folder and run:
npm install putt
For `speak` to work on Linux, install [Festival](http://www.cstr.ed.ac.uk/projects/festival/) and see what voices you have available (e.g. `voice_rab_diphone`).
For `desktop_notify` to work, install:
* Mac: [growl](http://code.google.com/p/growl/downloads/list), including the `growlnotify` extra
* Linux: `notify-send` with `sudo apt-get install libnotify-bin` or equivalent
# Usage
### Speech output
All output types take an options hash (optional), e.g.:
For `speak` to work:
putt().speak("I am talking", {voice: "Bruce"});
* Mac: it should just work
* Linux: install [Festival](http://www.cstr.ed.ac.uk/projects/festival/) and see what voices you have available (e.g. `voice_rab_diphone`)
All output types also have two optional callbacks that can be chained:
### Desktop notification output
* `done()` is called when the output finishes outputting
* `error(reason)` is called when an error is encountered during output
For `desktop_notify` output to work, install:
For example:
* Mac: [growl](http://code.google.com/p/growl/downloads/list), including the `growlnotify` extra
* Linux: `notify-send` with `sudo apt-get install libnotify-bin` or equivalent
putt().speak("I am talking").done(function() {
console.log("Finished talking");
}).error(function(reason) {
console.log("Something went wrong:", reason);
});
### POST request output
Note that you can chain these method calls in any order:
TODO
putt().done(function() {
console.log("Finished talking");
}).speak("I am talking");
### Email output
## Speech
putt().speak("This is spoken");
Options:
* `voice` the voice to use when speaking.
[See say.js docs](https://github.com/Marak/say.js) for a full list of voices
## Desktop notification
putt().desktop_notify("This is a desktop notification");
Options:
* `title` the title of the notification window
* `name` the name of the application
* `priority` (integer) the priority of the notification (default is 0)
* `sticky` (boolean) if notification should fade away or not
* `image` custom image to show along with notification
[See node-growl docs](https://github.com/visionmedia/node-growl) for more details
## POST request
putt().post({param1: value1, param2: value2}, {url: 'http://example.com/whatever'});
Options:
* `url` (required) the URL to POST to
* TODO - support more options
[See restler docs](https://github.com/danwrong/restler) for more details
## Email
TODO
### Twitter
## Tweet

@@ -48,0 +96,0 @@ First, [create a new Twitter application](https://dev.twitter.com/apps/new), and under the "Settings" tab, you will also want to give your app "Read and write" permissions so that we can write a tweet. Then, click the button at the bottom of the "Details" tab to generate an access token and secret.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc