read-pkg-owner

Get the owner of the package

Usage no npm install needed!

<script type="module">
  import readPkgOwner from 'https://cdn.skypack.dev/read-pkg-owner';
</script>

README

read-pkg-owner

Get the owner of the package by reading package json

Install

  $ yarn add read-pkg-owner

Use as CLI

Execute following in the repository you want owner for:

  $ read-pkg-owner

API

cwd

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

Use in your node project

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
  });

API

cwd

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
  });