JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 444
  • Score
    100M100P100Q99273F
  • License MIT

A tool for working with CODEOWNERS files

Package Exports

  • @nmann/codeowners
  • @nmann/codeowners/codeowners.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nmann/codeowners) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

codeowners

A tool for interacting with GitHub's CODEOWNERS files.

Usable as a CLI, or as a library.

installation

$ npm install -g codeowners

cli usage

Find the owner(s) of a given file or files:

$ codeowners of some/file.ts [...otherfiles]

Print a list of each files in the current repo, followed by its owner:

$ codeowners audit

To find a list of files not covered by the CODEOWNERS in the project:

$ codeowners audit --unowned

Specify a non-standard CODEOWNERS filename

$ codeowners audit -c CODEKEEPERS

Verify users/teams own a specific path

$ codeowners verify src/ @foob_ar @contoso/engineers

library usage

const Codeowners = require('codeowners');

// defaults to process.cwd(), but can pass a different directory path to constructor
const owners = new Codeowners();
owners.getOwner('path/to/file.js'); // => array of owner strings, e.g. ['@noahm']

Also has support for parsing out contact info for teams if listed in a space-separated-values format. Any number of arbitrary columns and headers can be used, but only lines beginning with "##" will be used.

# Team Contact Info
# Double pound characters are special signifiers of contact metadata.
## team slack-channel engineering-manager jira-project-key
## @twilight/bits #bits @bitsmanager BITS
## @twilight/bounty-board #bounty-board @janesmith BB
owners.contactInfo
// => array of info objects indexed by column name
[
  {
    team: '@twilight/bits',
    'slack-channel': '#bits',
    'engineering-manager': '@bitsmanager',
    'jira-project-key': 'BITS'
  },
  {
    team: '@twilight/bounty-board',
    'slack-channel': '#bounty-board',
    'engineering-manager': '@janesmith',
    'jira-project-key': 'BB'
  }
]

CHANGELOG

5.0.0

  • Much-improved performance
  • Removal of automatic column width calculation
  • Addition of -w/--width option for manual column width
    • Or use e.g. codeowners audit | column -ts " "