A Forecast (https://forecastapp.com) API wrapper for Node.js. Forked from inlight-media/node-forecast-api.
Via npm:
$ npm install --save forecast-promise
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.
const Forecast = require('forecast-promise');
const forecast = new Forecast({
accountId: '12345',
token: '54321.abc.1-EXAMPLETOKEN',
});
forecast.whoAmI().then(user => {
console.log(user);
});
forecast.people().then(people => {
console.log(people);
});
forecast.clients().then(clients => {
console.log(clients);
});
forecast.projects().then(projects => {
console.log(projects);
});
forecast.roles().then(roles => {
console.log(roles);
});
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 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);
});
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.