Get the owner of the package by reading package json
$ yarn add read-pkg-owner
Execute following in the repository you want owner for:
$ read-pkg-owner
type: string
default: process.cwd()
This is the path to directory where the repository exists.
Example:
# to get owner for a repo test which is in dir Users/workspace/test
$ read-pkg-owner --cwd Users/workspace/test
This package exports the function getOwner
which will give you the result
const readPkgOwner = require('read-pkg-owner');
readPkgOwner().then(owner => {
// do stuff with owner name
});
type: string
default: process.cwd()
This is the path to directory where the repository exists.
Example:
// to get owner for a repo test which is in dir Users/workspace/test
const readPkgOwner = require('read-pkg-owner');
readPkgOwner('Users/workspace/test').then(owner => {
// do stuff with owner name
});