January 25, 2021
GitLab is a popular tool not only for hosting git repositories, but for project management in general. It has many useful and powerful features available for its users to enjoy. It also has a fully featured API available which allows developers to easily interact with GitLab in whatever environment they wish to use.
For example, in NerdVision we make heavy use of Discord to interact with our community and also to manage our projects. By default there is very little integration between GitLab and Discord, so we’ve made nerd.bot which includes many helpful features such as: an auto-updating merge request list; and more detailed embeds whenever someone links to a resource on GitLab. This example is currently not available to the public, but we’re hoping to change that later this year 👀
This bot of course requires a lot of interaction with the GitLab API. There are many libraries available on npm for interacting with the GitLab API, but after searching, I felt that the ones that do get frequent updates were too closely tied to the GitLab API. GitLab is inherently a relation intensive application, and I was looking for a library that would exploit this to make my experience as a developer as simple as possible.
@nerdvision/gitlab-js aims to make interacting with the GitLab API as intuitive and easy as possible. For example, if I wanted to grab all open issues inside the ‘nerd-vision/opensource` group, I could just run:
The library is available on npm and can easily be installed with the following command:
You can then simply follow the example above to try it out & then adapt for your use case.
The library is in alpha and there may be breaking changes & parts that are not functional. It is not feature complete yet and is missing many of the GitLab API routes.
Need some functionality that we haven't implemented yet? Make an issue or implement it yourself and make a merge request!
If you need some help with the library you can make an issue or join us on Discord and we'll be happy to assist!
I'm a Software Engineer on the nerd.vision team. My skills mostly lie in the UI/Node area, but I also work with the backend services.