Giter VIP home page Giter VIP logo

node-asana's Introduction

Asana Build Status

A node.js client for the 1.0 version of the Asana API.

Design Decisions

  • Thin Wrapper This client is a thin wrapper which means that the client makes no attempt to verify the validity of the arguments locally. All errors are reported by the server. We include custom Error types which will contain the response from the server.
  • Promises Promises with bluebird seem like the most neutral way to support node's various async paradigms. If you want promises, you get them by default. If you want callbacks, bluebird promises support nodeify which takes a callback as parameter. For generators and streams, co and highland also support promises respectively. Beyond that, other major libraries such as mongoose, mocha, and elastic search (which uses bluebird) also support promises.

Examples

Find all incomplete tasks assigned to me that are new or marked for today across my workspaces

var asana = require('asana');
var util = require('util');

var client = asana.Client.basicAuth(process.env.ASANA_API_KEY);

client.users.me().then(function(user) {
  return user.workspaces.map(function(workspace) {
    return {
      user: user.id,
      workspace: workspace.id
    };
  });
}).map(function(data) {
  return client.tasks.findAll({
    assignee: data.user,
    workspace: data.workspace,
    completed_since: 'now',
    opt_fields: 'id,name,assignee_status,completed'
  }).filter(function(task) {
    return task.assignee_status === 'today' ||
      task.assignee_status === 'new';
  });
}).reduce(function(list, tasks) {
  return list.concat(tasks);
}, []).then(function(list) {
  console.log(util.inspect(list, {
    colors: true,
    depth: null
  }));
});

Installation

Install with npm

npm install asana --save

Documentation

The code is thoroughly documented with JsDoc tags and online documentation can be found on the wiki. Also, the Official Asana Documentation is a great resource since this is just a thin wrapper for the API.

Contributing

Feel free to fork and submit pull requests for the code. Please follow the existing code as an example of style and make sure that all your code passes lint and test. For a sanity check

git clone [email protected]:Asana/node-asana.git
cd node-asana
npm install
npm test

node-asana's People

Contributors

pspeter3 avatar troyastorino avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.