{"id":13989677,"url":"https://github.com/dwilding/trello-kb","last_synced_at":"2025-07-22T11:31:04.171Z","repository":{"id":41499401,"uuid":"110391765","full_name":"dwilding/trello-kb","owner":"dwilding","description":"A Node.js module that gets a Trello board as an array of self-contained content objects","archived":true,"fork":false,"pushed_at":"2018-05-07T01:42:45.000Z","size":1177,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-14T10:34:49.718Z","etag":null,"topics":["board","cms","html","knowledge-base","markdown","nodejs-modules","trello","yaml"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/trello-kb","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dwilding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-12T00:30:58.000Z","updated_at":"2024-07-24T04:01:28.000Z","dependencies_parsed_at":"2022-07-07T15:48:40.149Z","dependency_job_id":null,"html_url":"https://github.com/dwilding/trello-kb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dwilding/trello-kb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwilding%2Ftrello-kb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwilding%2Ftrello-kb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwilding%2Ftrello-kb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwilding%2Ftrello-kb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwilding","download_url":"https://codeload.github.com/dwilding/trello-kb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwilding%2Ftrello-kb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266483533,"owners_count":23936363,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["board","cms","html","knowledge-base","markdown","nodejs-modules","trello","yaml"],"created_at":"2024-08-09T13:01:56.916Z","updated_at":"2025-07-22T11:31:03.865Z","avatar_url":"https://github.com/dwilding.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Overview of Trello KB\n\nTrello KB enables you to get a [Trello](https://trello.com) board as an array of content objects. The objects in the array correspond to the cards on the board.\n\nFor example, you could create a magazine in Trello, then use Trello KB to get a JSON version of each article:\n\n![Trello card with JSON object](doc/food_magazine.jpg)\n\nTrello KB is not affiliated with Trello or Atlassian in any way.\n\n## Main Features\n\nTrello KB converts each card on the board to a self-contained object. The conversion process has the following main features:\n\n- **Markdown+YAML → HTML and nested objects.** Trello lets you [use a flavor of markdown to format card descriptions](http://help.trello.com/article/821-using-markdown-in-trello). Trello KB converts the card description to HTML and places the result in the `description` property.\n  \n  If the card description contains level 1 headers, Trello KB returns a separate property for each level 1 header. If the only content that follows a level 1 header is a code block, Trello KB assumes that the code block contains YAML, then converts the YAML to an object.\n  \n  For example, if the card description is:\n  \n  ``````text\n  This is a **card**\n\n  # More Details\n  - More text\n  - _Even more_ text\n\n  # Custom Data\n  ```\n  key: value\n  array:\n  - one\n  - two\n  ```\n\n  # Summary\n  Summary text\n  ``````\n  \n  Trello KB returns the following properties:\n  \n  ```text\n  \"description\": \"\u003cp\u003eThis is a \u003cstrong\u003ecard\u003c/strong\u003e\u003c/p\u003e\",\n  \"more_details\": \"\u003cul\u003e\\n\u003cli\u003eMore text\u003c/li\u003e\\n\u003cli\u003e\u003cem\u003eEven more\u003c/em\u003e text\u003c/li\u003e\\n\u003c/ul\u003e\",\n  \"custom_data\": {\n    \"key\": \"value\",\n    \"array\": [\n      \"one\",\n      \"two\"\n    ]\n  },\n  \"summary\": \"\u003cp\u003eSummary text\u003c/p\u003e\"\n  ```\n  \n  \u003e **NOTE:** Trello KB does not support [MSON](https://github.com/apiaryio/mson).\n\n- **Card links → object links.** If you enter the [URL of a card](http://help.trello.com/article/824-sharing-links-to-cards-and-boards) in the card description, Trello displays a dynamic card link. For example:\n  \n  ![Card link in a card description](doc/card_link.png)\n  \n  Trello KB converts card links to object links. For example, if you enter https://trello.com/c/7l47ZiYm in the card description, Trello KB produces the following object link:\n  \n  ```html\n  \u003ca href=\"#59f3d9f34c8b2c69fdbbf940\"\u003eMake the perfect carrot cake\u003c/a\u003e\n  ```\n  \n  You should use the [linkTargetURL](#linktargeturl) option to customize the URLs of object links according to your needs.\n  \n  \u003e **NOTE:** Trello KB only supports links to cards on the same board. Trello KB does not support links to comments, actions, or boards.\n\n- **Labels → Booleans.** Trello lets you [add labels to cards](http://help.trello.com/article/797-adding-labels-to-cards). For each label on the board, Trello KB returns a Boolean property that indicates whether the card has the label.\n  \n  For example, if the card has a label called \"Opinion Piece\" and there is also an unnamed yellow label on the board, Trello KB returns the following properties:\n  \n  ```text\n  \"yellow\": false,\n  \"opinion_piece\": true\n  ```\n\n# Get a Board\n\n## Prerequisites\n\n- You must have [Node.js](https://nodejs.org) and the `trello-kb` module installed. To install the `trello-kb` module using [npm](https://www.npmjs.com/), run the following command:\n  \n  ```shell\n  npm install trello-kb\n  ```\n\n- You must have a Trello account. If you do not have a Trello account, create an account at https://trello.com/signup. If you are building a Trello integration, Trello recommends that you create a Trello account specifically for your integration.\n  \n  You will need to provide Trello KB with the application key of your Trello account. To view the application key of your Trello account, visit https://trello.com/app-key.\n\n- You will need to provide Trello KB with an authorization token for a Trello account that has access to the board. See [Authorization](https://developers.trello.com/page/authorization) for how to request an authorization token. The authorization token must include the `read` scope.\n  \n  If your Trello account has access to the board, the simplest way to obtain a suitable authorization token is to visit the following URL:\n  \n  ```text\n  https://trello.com/1/authorize?key=APP_KEY\u0026name=Test%20Integration\u0026scope=read\u0026expiration=never\u0026response_type=token\n  ```\n  \n  Replace `APP_KEY` by the application key of your Trello account.\n\n- You will need to provide Trello KB with the ID of the board. You can obtain the ID from the URL of the board. For example, the ID of [this board](https://trello.com/b/dMFueFPQ/food-magazine) is \"dMFueFPQ\".\n\n## Example\n\n```javascript\nconst trelloKB = require('trello-kb');\n\n// Replace this by the application key of your Trello account\nvar appKey = '4dee095cf22f1793eb435fdac9e9ebec';\n\n// Replace this by a valid authorization token\nvar authToken = 'ca1dd89c602cb34e8558d9451cdc7727855e3803d885aeb7b671bd64ac7d6bea';\n\n// Get the board https://trello.com/b/dMFueFPQ/food-magazine\ntrelloKB.get(appKey, authToken, 'dMFueFPQ').then(\n  function (cards) {\n    // Print the title of each card\n    cards.forEach(function (card) {\n      console.log(card.title);\n    });\n  },\n  function (reason) {\n    // If there were warnings, display each warning\n    if (reason.name == 'BoardConversionWarnings') {\n      reason.warnings.forEach(function (warning) {\n        console.error(warning);\n      });\n    }\n    // Otherwise, display the error message\n    else {\n      console.error(reason.message);\n    }\n  }\n);\n```\n\nOutput:\n\n```text\nMushrooms: the definitive guide\nNew burger restaurant opens downtown\nShortage of ice cream causes panic across the city\nMake the perfect carrot cake\nHow strawberries will transform the way you eat breakfast\n```\n\nSee [doc/cards.json](doc/cards.json) for a JSON version of the `cards` array in this example.\n\n# Card Object Reference\n\nFor each card on the board, Trello KB returns an object with the following properties:\n\n| Property      | Description                                                                                                                                                                                                                                                                                                                                                                           |\n|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id`          | \u003cp\u003eThe Trello ID of the card.\u003c/p\u003e\u003cp\u003eYou can use the [shortCardIds](#shortcardids) option to control the format of this property.\u003c/p\u003e                                                                                                                                                                                                                                                  |\n| `title`       | \u003cp\u003eThe card title.\u003c/p\u003e                                                                                                                                                                                                                                                                                                                                                                |\n| `list`        | \u003cp\u003eThe name of the list that the card is in.\u003c/p\u003e                                                                                                                                                                                                                                                                                                                                      |\n| `cover`       | \u003cp\u003eThe URL of the card cover.\u003c/p\u003e\u003cp\u003eOnly available if [a cover image has been attached to the card](http://help.trello.com/article/769-adding-attachments-to-cards).\u003c/p\u003e\u003cp\u003eYou can use the [getCovers](#getcovers) option to control whether Trello KB returns this property.\u003c/p\u003e                                                                                                     |\n| `date`        | \u003cp\u003eThe due date of the card.\u003c/p\u003e\u003cp\u003eOnly available if [a due date has been added to the card](http://help.trello.com/article/794-adding-due-dates-to-cards).\u003c/p\u003e                                                                                                                                                                                                                       |\n| `draft`       | \u003cp\u003eTrue if the card has a due date but the due date has not been marked as complete; false otherwise.\u003c/p\u003e                                                                                                                                                                                                                                                                             |\n| _label_       | \u003cp\u003eFor each label on the board, a Boolean that indicates whether the card has the label. See [Main Features](#main-features).\u003c/p\u003e\u003cp\u003eYou can use the [keyFromText](#keyfromtext) option to control how Trello KB converts label names to property names.\u003c/p\u003e                                                                                                                           |\n| `description` | \u003cp\u003eAn HTML version of the card description that precedes level 1 headers. See [Main Features](#main-features).\u003c/p\u003e                                                                                                                                                                                                                                                                    |\n| _header_      | \u003cp\u003eFor each level 1 header in the card description:\u003c/p\u003e\u003cul\u003e\u003cli\u003ean HTML version of the content that follows the header; or\u003c/li\u003e\u003cli\u003ethe object described by the YAML code block that follows the header.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eSee [Main Features](#main-features).\u003c/p\u003e\u003cp\u003eYou can use the [keyFromText](#keyfromtext) option to control how Trello KB converts header text to property names.\u003c/p\u003e |\n\nYou can use the [Trello REST API](https://developers.trello.com/v1.0/reference#cardsid) to get additional card details.\n\n# Module Options\n\n## getArchived\n\nThe `getArchived` option is a Boolean that specifies whether Trello KB gets archived cards. The default value is false, which means that Trello KB gets only the cards that are visible on the board.\n\nTo get all visible and archived cards:\n\n```javascript\nconst trelloKB = require('trello-kb');\n\ntrelloKB.options.getArchived = true;\n```\n\n## getCovers\n\nThe `getCovers` option is a Boolean that specifies whether Trello KB gets the URLs of card covers. The default value is true, which means that if a cover image has been attached to a card, Trello KB returns the URL of the image in a property called `cover`.\n\nTo ignore card covers:\n\n```javascript\nconst trelloKB = require('trello-kb');\n\ntrelloKB.options.getCovers = false;\n```\n\n## shortCardIds\n\nThe `shortCardIds` option is a Boolean that specifies whether Trello KB uses short IDs (e.g., \"Xrf9TsE1\") for card objects. The default value is false, which means that Trello KB uses long IDs (e.g., \"59f3d975e68c2ace90bbc3c5\") for card objects.\n\nTo use short IDs for card objects:\n\n```javascript\nconst trelloKB = require('trello-kb');\n\ntrelloKB.options.shortCardIds = true;\n```\n\n## keyFromText\n\nThe `keyFromText` option is a function that specifies how Trello KB converts label names and header text to property names. The default function returns names that contain only lower case letters, digits, and underscores.\n\nTo disable conversion of label names and header text:\n\n```javascript\nconst trelloKB = require('trello-kb');\n\ntrelloKB.options.keyFromText = function (text, type) {\n  // text is a plain text string\n  // type is either 'label' or 'header'\n  return text;\n};\n```\n\n\u003e **NOTE:** Trello KB converts header text to plain text before applying `keyFromText`. To completely disable conversion for a particular header, surround the header text by backticks.\n\n## headerMap\n\nThe `headerMap` option is a function that specifies how Trello KB handles level 2-6 headers in card descriptions. The default function maps level _N_ headers to level _N_ \u0026minus; 1 headers, which means that level 2 headers in card descriptions become level 1 headers in the HTML that Trello KB returns.\n\nTo disable renumbering of headers:\n\n```javascript\nconst trelloKB = require('trello-kb');\n\ntrelloKB.options.headerMap = function (source, key, level) {\n  // source is the object that contains the header\n  // key is the name of the property that contains the header\n  // level is an integer in the range 2 to 6\n  return level;\n};\n```\n\n\u003e **NOTE:** When Trello KB applies `headerMap`, some properties of the source object may be null. This limitation only applies to properties that should contain HTML, such as the `description` property.\n\n## headerId\n\nThe `headerId` option is a function that specifies the IDs of headers in the HTML that Trello KB returns. The default function returns IDs that contain only lower case letters, digits, and hyphens.\n\nTo remove IDs from headers:\n\n```javascript\nconst trelloKB = require('trello-kb');\n\ntrelloKB.options.headerId = function (source, key, text) {\n  // source is the object that contains the header\n  // key is the name of the property that contains the header\n  // text is a plain text version of the header text\n  return '';\n};\n```\n\n\u003e **NOTE:** When Trello KB applies `headerId`, some properties of the source object may be null. This limitation only applies to properties that should contain HTML, such as the `description` property.\n\n## linkTargetURL\n\nThe `linkTargetURL` option is a function that specifies the URLs of object links in the HTML that Trello KB returns. The default function returns \"#\" followed by the value of the target object's `id` property.\n\nTo replace object links by their link text:\n\n```javascript\nconst trelloKB = require('trello-kb');\n\ntrelloKB.options.linkTargetURL = function (source, key, target) {\n  // source is the object that contains the link\n  // key is the name of the property that contains the link\n  // target is the object that the link points to\n  return '';\n};\n```\n\n\u003e **NOTE:** When Trello KB applies `linkTargetURL`, some properties of the source and target objects may be null. This limitation only applies to properties that should contain HTML, such as the `description` properties.\n\n## strictWarnings\n\nThe `strictWarnings` option is a Boolean that specifies whether Trello KB returns a rejected promise if warnings were generated during the conversion process. The default value is true, which means that Trello KB returns a rejected promise if any of the following conditions occur:\n\n- A code block in a card description contains invalid YAML\n- A card description contains a link to a comment, action, or board\n- A card description contains a link to a card that Trello KB did not get\n- [headerMap](#headermap) returns a level that is less than 1 or greater than 6\n- [headerMap](#headermap), [headerId](#headerid), or [linkTargetURL](#linktargeturl) generates an error\n\nTo ignore these conditions:\n\n```javascript\nconst trelloKB = require('trello-kb');\n\ntrelloKB.options.strictWarnings = false;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwilding%2Ftrello-kb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwilding%2Ftrello-kb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwilding%2Ftrello-kb/lists"}