JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2906
  • Score
    100M100P100Q104645F
  • License BSD

Use PushBullets REST API

Package Exports

  • pushbullet

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pushbullet) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

PushBullet API

A Node.js module for using the PushBullet REST API.

Usage

This module is very simple to use. All you need is your PushBullet API key and you can begin pushing.

var PushBullet = require('pushbullet');
var pusher = new PushBullet('YOUR-API-KEY');

pusher.devices(function(error, response) {
    // response is the JSON response from the API
});

pusher.note(deviceId, noteTitle, noteBody, function(error, response) {
    // response is the JSON response from the API
});

Callbacks

Each callback receives two arguments. For a successful request the first argument will be null or undefined and the second argument will be the parsed JSON response from the API.

If an error occurs at any part of the request the first argument will be an Error object.

API

PushBullet.devices(callback)

Retrieves a list of pushable devices.

pusher.devices(function(error, response) {});

PushBullet.note(deviceId, noteTitle, noteBody, callback)

Push a note to the specified device.

pusher.note(12345, 'New Note', 'Note body text', function(error, response) {});

PushBullet.address(deviceId, name, address, callback)

Push an address to the specified device.

pusher.note(12345, 'Fake Address', '10 Fake Street, Fakesville', function(error, response) {});

PushBullet.list(deviceId, name, listItems, callback)

Push a list to the specified device.

var shoppingList = [
    'steaks',
    'sausages',
    'burgers',
    'buns',
    'beer'
]
pusher.note(12345, 'BBQ', shoppingList, function(error, response) {});

PushBullet.link(deviceId, name, url, callback)

Push a link to the specified device.

pusher.link(12345, 'GitHub', 'https://github.com/', function(error, response) {});

PushBullet.file(deviceId, filePath, callback)

Push a file to the specified device.

pusher.file(12345, '/path/to/file', function(error, response) {});