Socket
Book a DemoInstallSign in
Socket

@gitlab/codeowners

Package Overview
Dependencies
Maintainers
7
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gitlab/codeowners

Parse GitLab CODEOWNERS files

latest
Source
npmnpm
Version
0.2.7
Version published
Weekly downloads
3.6K
-2.25%
Maintainers
7
Weekly downloads
 
Created
Source

GitLab CodeOwners parser

A GitLab CodeOwners parser for Node.js, written in TypeScript.

It aims to implement all documented features of the format, but it's not quite there yet. Consider this alpha-quality software for now!

Installation

npm install @gitlab/codeowners

Usage

import { parse } from '@gitlab/codeowners';

const codeowners = await parse('./CODEOWNERS');

const owners = codeowners.getOwners('README.md'); // ['@user', '@group']

const ownersDetailed = codeowners.getOwnersDetailed('README.md'); /* =>
[{
  owner: '@user',
  type: 'directOwner',
  section: 'codeowners',
  optional: true,
  approvalsNeeded: 1,
},{
  owner: '@group',
  type: 'defaultOwner',
  section: 'Maintainers',
  optional: false,
  approvalsNeeded: 5,
}]
*/

Versioning

This project will use semantic versioning. Particularly, note item 4:

Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

This project will reach 1.0.0 once it supports all features documented by GitLab.

TODO

This is not yet a complete implementation of a GitLab CODEOWNERS parser. Here's a non-exhaustive list of things where are not implemented/supported:

FAQs

Package last updated on 27 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts