Skip to content

Instantly share code, notes, and snippets.

@rujmah
Last active May 9, 2018 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rujmah/ee659230737468bf1977921d441ad50f to your computer and use it in GitHub Desktop.
Save rujmah/ee659230737468bf1977921d441ad50f to your computer and use it in GitHub Desktop.
Trello: Quick list from JSON using Node
// export json from trello board
const board = require('./path/to/trelloboard.json')
for(let list of board.lists){
let listcards = board.cards.filter(c => c.idList === list.id )
console.log(list.name)
for(let card of listcards){
console.log(`\t${card.name} [${card.desc}]`)
}
}
/**
Output:
List A
Card 1 [desc here]
Card 2 []
List B
Card 3 [more desc]
...
*/
// change path at start of line
// copy&paste to node cli;
const board = require('./path/to/trelloboard.json'); for(let list of board.lists){ let listcards = board.cards.filter(c => c.idList === list.id ); console.log(list.name); for(let card of listcards){ console.log(`\t${card.name} [${card.desc}]`) } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment