No description, website, or topics provided.
Branch: master
Clone or download
Pull request Compare This branch is 10 commits ahead, 21 commits behind dan1elhughes:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.eslintrc.json
.gitignore
README.md
index.js
package-lock.json
package.json
test.js

README.md

Node Forecast promise API

A Forecast (https://forecastapp.com) API wrapper for Node.js. Forked from inlight-media/node-forecast-api.

Installation

Via npm:

$ npm install --save forecast-promise

Getting started

You will need a Forecast account, accountId and personal access token.

To find your accountId and generate the token, log into Forecast and go to Developers, then click Create New Personal Access Token.

Usage

const Forecast = require('forecast-promise');
const forecast = new Forecast({
	accountId: '12345',
	token: '54321.abc.1-EXAMPLETOKEN'
});

WhoAmI

forecast.whoAmI().then(user => {
	console.log(user);
});

People

forecast.people().then(people => {
	console.log(people);
});

Clients

forecast.clients().then(clients => {
	console.log(clients);
});

Projects

forecast.projects().then(projects => {
	console.log(projects);
});

Roles

forecast.roles().then(roles => {
	console.log(roles);
});

Assignments

Assignments supports the following options (see below for more details):

  • startDate
  • endDate
var options = {
	startDate: new Date(),
	endDate: new Date(2018, 11, 25)
};
forecast.assignments(options).then(assignments => {
	console.log(assignments);
});

Assignments can also be called without options and will use a default start and end date.

forecast.assignments().then(assignments => {
	console.log(assignments);
});

Milestones

Milestones supports the following options (see below for more details):

  • startDate
  • endDate
var options = {
	startDate: new Date(),
	endDate: new Date(2018, 11, 25)
};
forecast.milestones(options).then(milestones => {
	console.log(milestones);
});

Milestones can also be called without options.

forecast.milestones().then(milestones => {
	console.log(milestones);
});

Options

  • startDate - a native date object, a moment.js date object or an ISO-8601 compatible date string.
  • endDate - a native date object, a moment.js date object or an ISO-8601 compatible date string.