npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@openlab/trello-client

v0.1.2

Published

This project is a **partial** implementation of the [Trello REST API](https://developers.trello.com/reference). Endpoints will be added as they are needed for projects.

Downloads

10

Readme

trello-client

This project is a partial implementation of the Trello REST API. Endpoints will be added as they are needed for projects.

Table of contents

Current functionality

npm install @openlab/trello-client
import { TrelloClient, labelColors } from '@openlab/trello-client'

// Load in environment variables
const { TRELLO_APP_KEY, TRELLO_TOKEN, BOARD_ID } = process.env

//
// Create a client instance
//
const trello = new TrelloClient(TRELLO_APP_KEY, TRELLO_TOKEN)

//
// Fetch the organizations for the current user
//
const orgs = await trello.fetchOrganizations()

//
// Fetch boards for the current user
//
const boards = await trello.fetchBoards()

//
// Fetch the labels from a board
//
const labels = await trello.fetchLabels(BOARD_ID)

//
// Fetch the lists on a board
//
const lists = await trello.fetchLists(BOARD_ID)

//
// Create a new label
//
const newLabel = await trello.createLabel(BOARD_ID, {
  name: 'To-do',
  color: 'sky'
})

//
// Create a new card
// See types.ts – CardRequest for more parameters
//
const newCard = await trello.createCard({
  name: 'Document project',
  desc: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
  idList: 'some-list-mongo-id'
})

There are also types and interfaces exported from types.ts

Future work

  • Add more endpoints
  • Add more complex types to capture ?fields query parameters which have varadic responses

Development

Setup

To develop on this repo you will need to have node.js installed on your dev machine and have an understanding of it. This guide assumes you have the repo checked out and are on macOS, but equivalent commands are available.

You'll only need to follow this setup once for your dev machine.

# Install npm dependencies
npm install

Regular use

These are the commands you'll regularly run to develop the API, in no particular order.

# Run tests and re-run on changes
# -> Exit with control+C
npm run test -- --watch

Irregular use

These are commands you might need to run but probably won't, also in no particular order.

# Test-run the preversion hook
# -> Runs automated tests
# -> Compiles typescript to javascript
npm run preversion

# Compiles typescript to javascript
npm run build

# Generate the table of contents in this readme
npm run generate-toc

Testing

This repo uses unit tests to ensure that everything is working correctly, guide development, avoid bad code and reduce defects. The Jest package is used to run unit tests. Tests are any file in src/ that end with .spec.ts, by convention they are inline with the source code, in a parallel folder called __tests__.

# Run the tests
npm test -s

# Generate code coverage
npm run coverage -s

Commits

All commits to this repo must follow Conventional Commits. This ensures changes are structured and means the CHANGELOG.md can be automatically generated.

This standard is enforced through a commit-msg hook using yorkie.

Code formatting

This repo uses Prettier to automatically format code to a consistent standard. It works using the yorkie and lint-staged packages to automatically format code whenever it is commited. This means that code that is pushed to the repo is always formatted to a consistent standard.

You can manually run the formatter with npm run prettier if you want.

Prettier is slightly configured in package.json and will ignore files defined in .prettierignore.

Publishing

This repo is responsible for the @openlab/trello-client NPM package.

# Create a new version of the project
# -> Picks a new version based on the commits since the last version
# -> Following https://www.conventionalcommits.org/en/v1.0.0/
# -> Generates the CHANGELOG.md based on those commits
npm run release

# Push the version commit and tag to git
git push --follow-tags

# Publish the npm package
npm publish

The code on https://github.com/unplatform/trello-client is a mirror of https://openlab.ncl.ac.uk/gitlab/catalyst/trello-client