
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
codeowners-api
Advanced tools
Simple module to interact with github codeowners This npm module was implemented mainly to support the chrome extension - codeowners-ext
In order to get all the teams a user is part of, you need to provide a Github access token. The required permissions are:
> yarn add codeowners-api
import {Codeowner} from 'codeowners-api';
const repoParams = {repo: 'my-repo', owner: 'repo-owner'}
const authParams = {type: 'token', token: 'xxxx'}
const codeOwnersApi = new Codeowner(repoParams, authParams);
const result = await codeOwnersApi.filterForCodeOwner(
['/something/a.py', 'tests/something.js', 'tests/something.txt', 'packages/some/deep/dir/index.tsx'],
'@elaygl'
);
console.log(result) // [ 'tests/something.txt', 'packages/some/deep/dir/index.tsx' ]
Given an array of paths and an array of github users/teams (prefixed with @), returns the paths that these users/teams are the codeowners of.
Example:
const result = await codeOwnersApi.filterForCodeOwners(
['package.json', 'tests/something.js', 'tests/something.txt', 'packages/some/deep/dir/index.tsx'],
['@elaygl', '@Soluto/mobile-team']
);
console.log(result) // ['package.json']
Given an array of paths, returns the paths that this authenticated user is the codeowner of (based on the Auth credentials passed in the constructor). Using GithubAPI, the library will also get all the list of teams that this user is part of, inorder to return the mapping which includes this user, and all his/her teams
Example:
const result = await codeOwnersApi.filterForAuthenticatedUser(
['package.json', 'tests/something.js', 'tests/something.txt', 'packages/some/deep/dir/index.tsx']
);
console.log(result) // ['package.json']
Returns true if a CODEOWNERS file exists for the given github repo
Returns string of the CODEOWNERS file in the given repo
> yarn test
Based on this CODEOWNERS file:
#This is a comment
* @oreporan
/tests/*.txt @elaygl
# Another Comment!!
/tests/test2/someFile.txt @oreporan
/packages/some/ @elaygl
Will generate this result:
import {Codeowner} from 'codeowners-api';
const repoParams = {repo: 'my-repo', owner: 'repo-owner'}
const authParams = {type: 'token', token: 'xxxx'}
const codeOwnersApi = new Codeowner(repoParams, authParams);
const result = await codeOwnersApi.filterForCodeOwner(
['/something/a.py', 'tests/something.js', 'tests/something.txt', 'packages/some/deep/dir/index.tsx'],
'@elaygl'
);
console.log(result) // [ 'tests/something.txt', 'packages/some/deep/dir/index.tsx' ]
Ore Poran and Elay Gliskberg
FAQs
Simple module to interact with github codeowners
The npm package codeowners-api receives a total of 9 weekly downloads. As such, codeowners-api popularity was classified as not popular.
We found that codeowners-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.