Trello Yello is a high-level object-oriented wrapper for the Trello API. It greatly simplifies the process of interacting with the Trello public API and allows you to script nearly every action available through their API in an easy-to-learn, easy-to-use manner.
Trello is a free web application that helps with project organization, simple to-do lists, notetaking, etc. You can take a tour here.
While Trello's API provides a great deal of utility and power, it is a bit unwieldy to work with. A good deal of effort is spent building complex HTTP queries and parsing large JSON objects. Trello Yello handles all of that for you, and lets you work with objects and operations that map directly to the Trello elements that you're used to.
npm install trello-yello
Trello Yello has several quirks that are worth mentioning.
Promiseand will also accept an optional callback function (error-first).
Promise. It may just be a
Promisethat is resolved immediately.
newan object in Trello Yello.
Trello Yello requires both an application key and a user token. Here are instructions on how to get those:
An example URL for getting a token that has all permissions and never expires (don't worry, you can delete it later from your settings or even through Trello Yello):
Getting a reference to the module:
var trello = ;
Now you will need to instantiate the trello service.
var trelloService = ;
Great! Now you have the (Trello) world at your fingers. The first thing you need to do is get a Trello Object. For example, let's say you want to rename a Card and you know its id.
A lot of the time you won't know the id. Let's say you want to retrieve a board that the user belongs to, but all you know is the name.
var myBoard;var myBoards;trelloService;
From here you can make changes to the board, or access objects on the board such as cards, lists, labels, or the board's organization, and perform actions on those.
What if you want to change the name of your list?
Maybe you have a webhook that you're not using anymore
Or you can delete properties on an object. Maybe you want to remove a label from a card.
You can run searches on Trello easily.
// Setting the name of the green label for a board:trelloService;// Archiving all the cards in a listtrelloService;// Adding a comment to a cardtrelloService;// Getting all of the user's unread notificationsvar allNotifications;var unreadNotifications;trelloService;// Deleting a checklist itemtrelloService;// Deleting a labeltrelloService;
Most Trello API operations have specific functions associated with the type of object being operated on. However, for experienced users, you can build your own Trello query.
// Performing a GET operation on the Trello API. Trello object is an object such as a card or a listvar property = trelloObject;// Performing a PUT or POST operation on the Trello APItrelloObject;// Here's a specific example for updating an organization's descriptionorganization;// Update a member's saved searchmember;
Trello Yello will check internally if the query you have is a valid API call. This prevents creating a network connection when the application knows it will fail. However, there may be times where Trello Yello is either out of date, or doesn't support the specific operation you are trying to perform. In this case, set the parameters property
true. The above example would thus become:
Well, aside from the obvious rhyme, and the reference to the beverage Mello Yello, using Trello Yello should be refreshing. Like an ice cold citrus drink on a hot summer day. I don't know. It's a name. What more do you want from me?
Anyone is welcome to contribute! Please follow the recommended GitHub steps.
Released under the MIT license.