Skip to content

Node wrapper for the Onfleet API

License

Notifications You must be signed in to change notification settings

delivery-solutions/onfleet-node

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Onfleet node.js bindings

Installation

npm install onfleet

API Overview

Every resource is accessed via your onfleet instance:

var onfleet = require('onfleet')('YOUR_ONFLEET_API_KEY');

Every resource method accepts an optional callback as the last argument:

onfleet.tasks.create(
  { ... },
  function(error, task) {
    error; // null if no error occurred
    task; // the created task object
  }
);

Additionally, every resource method returns a promise, so you don't have to use the regular callback. E.g.

// Create a new task :
onfleet.tasks.create(
  { ... }
).then(function(task) {
  // New task created
}).catch(function(err) {
  // Deal with an error
});

Available resources & methods

Where you see params it is a plain JavaScript object, e.g. { email: '[email protected]' }

About

Node wrapper for the Onfleet API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%