Skip to content

ajaymathur/read-pkg-owner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published