npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

typhonjs-github-inspect-orgs-transform

v0.1.0

Published

A NPM module transforming compound GitHub queries for many-repo projects from typhonjs-github-inspect-orgs to HTML, JSON, Markdown or text.

Downloads

3

Readme

typhonjs-github-inspect-orgs-transform

NPM Code Style License Gitter

Build Status Coverage Dependency Status

Provides a NPM module that transforms data from GitHubInspectOrgs / typhonjs-github-inspect-orgs to normalized HTML, markdown, JSON or text by piping to console or a provided function along with returning the output of GitHubInspectOrgs in addition to the transformed data via Promises. The API mirrors typhonjs-github-inspect-orgs and requires an instance of GitHubInspectOrgs injected into the constructor of GitHubInspectOrgsTransform. GitHubInspectOrgsTransform excels at creating indexes in several popular formats for a many-organization / repo effort such as TyphonJS and beyond.

By default the following transform types are available: html, json, markdown and text and initially set in an options hash with an optional transformType entry passed into the constructor as the second parameter. All methods transform normalized output data from a GitHubInspectOrgs query as a string, but user supplied transforms may output any type of data.

To configure GitHubInspectOrgsTransform first create an instance of GitHubInspectOrgs:

import GitHubInspectOrgs          from 'typhonjs-github-inspect-orgs';
import GitHubInspectOrgsTransform from 'typhonjs-github-inspect-orgs-transform';

const githubInspect = new GitHubInspectOrgs(
{
    organizations: [{ credential: <GITHUB PUBLIC TOKEN>, owner: <GITHUB USER NAME OWNING ORGANIZATIONS>,
                    regex: '^typhonjs' }],
});

const inspectTransform = new GitHubInspectOrgsTransform(githubInspect);

Additional optional parameters to configure GitHubInspectOrgsTransform include:

(string)    transformType - The current transform type; default ('text').

(object)    transforms - A hash with user supplied transforms to add to TransformControl.

While creating custom transforms is not discussed in detail please review the current implementations in ./src/transform for guidance.

Each method of GitHubInspectOrgsTransform forwards on any options also supported by typhonjs-github-inspect-orgs. In addition GitHubInspectOrgsTransform may also take optional parameters. In particular a pipeFunction function entry is invoked immediately with the resulting transformed data. The transformed results are added to the original data returned by a given query with a new key transformed and returned as a Promise.

Most methods take a hash of optional parameters. The four optional parameters that are supported include:

(string)    credential - A public access token with `public_repo` and `read:org` permissions for any GitHub
                         user which limits the responses to the organizations and other query data that this
                         particular user is a member of or has access to currently.

(boolean)   description - Add additional description info for all entries where available; default (false).

(function)  pipeFunction - A function that will be invoked with a single parameter with the transformed result.

(string)    transformType - Overrides current TransformControl transform type.

Please review ./test/fixture for examples of transformed output used in testing. These examples are generated from typhonjs-test organizations.


GitHubInspectOrgsTransform method summary:

  • getCollaborators - Transforms all collaborators across all organizations.
  • getContributors - Transforms all contributors across all organizations.
  • getMembers - Transforms all organization members across all organizations.
  • getOrgMembers - Transforms all members by organization across all organizations.
  • getOrgRepos - Transforms all repos by organization across all organizations.
  • getOrgRepoCollaborators - Transforms all collaborators by repo by organization across all organizations.
  • getOrgRepoContributors - Transforms all contributors by repo by organization across all organizations.
  • getOrgRepoStats - Transforms GitHub statistics by repo by organization across all organizations.
  • getOrgs - Transforms all organizations.
  • getOrgTeams - Transforms all teams by organization across all organizations.
  • getOrgTeamMembers - Transforms all members by team by organization across all organizations.
  • getOwnerOrgs - Transforms all organizations by organization owner.
  • getOwnerRateLimits - Transforms the current rate limits for all organization owners.
  • getOwners - Transforms all organization owners.
  • getUserFromCredential - Transforms the GitHub user who owns the provided credential.

####getCollaborators

Transforms all normalized data from GitHubInspectOrgs->getCollaborators returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

@param {object} options - Optional parameters.

(string)    credential - A public access token with `public_repo` and `read:org` permissions for any GitHub
                         user which limits the responses to the organizations and other query data that this
                         particular user is a member of or has access to currently.

(boolean)   description - Add additional description info for all entries where available; default (false).

(function)  pipeFunction - A function that will be invoked with a single parameter with the transformed result.

(string)    transformType - Overrides current TransformControl transform type.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getCollaborators

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getContributors

Transforms all normalized data from GitHubInspectOrgs->getContributors returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

@param {object} options - Optional parameters.

(string)    credential - A public access token with `public_repo` and `read:org` permissions for any GitHub
                         user which limits the responses to the organizations and other query data that this
                         particular user is a member of or has access to currently.

(boolean)   description - Add additional description info for all entries where available; default (false).

(function)  pipeFunction - A function that will be invoked with a single parameter with the transformed result.

(string)    transformType - Overrides current TransformControl transform type.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getContributors

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getMembers

Transforms all normalized data from GitHubInspectOrgs->getMembers returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

@param {object} options - Optional parameters.

(string)    credential - A public access token with `public_repo` and `read:org` permissions for any GitHub
                         user which limits the responses to the organizations and other query data that this
                         particular user is a member of or has access to currently.

(boolean)   description - Add additional description info for all entries where available; default (false).

(function)  pipeFunction - A function that will be invoked with a single parameter with the transformed result.

(string)    transformType - Overrides current TransformControl transform type.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getMembers

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getOrgMembers

Transforms all normalized data from GitHubInspectOrgs->getOrgMembers returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

@param {object} options - Optional parameters.

(string)    credential - A public access token with `public_repo` and `read:org` permissions for any GitHub
                         user which limits the responses to the organizations and other query data that this
                         particular user is a member of or has access to currently.

(boolean)   description - Add additional description info for all entries where available; default (false).

(function)  pipeFunction - A function that will be invoked with a single parameter with the transformed result.

(string)    transformType - Overrides current TransformControl transform type.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getOrgMembers

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getOrgRepos

Transforms all normalized data from GitHubInspectOrgs->getOrgRepos returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

@param {object} options - Optional parameters.

(string)    credential - A public access token with `public_repo` and `read:org` permissions for any GitHub
                         user which limits the responses to the organizations and other query data that this
                         particular user is a member of or has access to currently.

(boolean)   description - Add additional description info for all entries where available; default (false).

(function)  pipeFunction - A function that will be invoked with a single parameter with the transformed result.

(string)    transformType - Overrides current TransformControl transform type.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getOrgRepos

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getOrgRepoCollaborators

Transforms all normalized data from GitHubInspectOrgs->getOrgRepoCollaborators returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

@param {object} options - Optional parameters.

(string)    credential - A public access token with `public_repo` and `read:org` permissions for any GitHub
                         user which limits the responses to the organizations and other query data that this
                         particular user is a member of or has access to currently.

(boolean)   description - Add additional description info for all entries where available; default (false).

(function)  pipeFunction - A function that will be invoked with a single parameter with the transformed result.

(string)    transformType - Overrides current TransformControl transform type.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getOrgRepoCollaborators

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getOrgRepoContributors

Transforms all normalized data from GitHubInspectOrgs->getOrgRepoContributors returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

@param {object} options - Optional parameters.

(string)    credential - A public access token with `public_repo` and `read:org` permissions for any GitHub
                         user which limits the responses to the organizations and other query data that this
                         particular user is a member of or has access to currently.

(boolean)   description - Add additional description info for all entries where available; default (false).

(function)  pipeFunction - A function that will be invoked with a single parameter with the transformed result.

(string)    transformType - Overrides current TransformControl transform type.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getOrgRepoContributors

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getOrgRepoStats

Transforms all normalized data from GitHubInspectOrgs->getOrgRepoStats returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

@param {object} options - Optional parameters.

(string)    credential - A public access token with `public_repo` and `read:org` permissions for any GitHub
                         user which limits the responses to the organizations and other query data that this
                         particular user is a member of or has access to currently.

(boolean)   description - Add additional description info for all entries where available; default (false).

(function)  pipeFunction - A function that will be invoked with a single parameter with the transformed result.

(string)    transformType - Overrides current TransformControl transform type.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getOrgRepoStats

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getOrgs

Transforms all normalized data from GitHubInspectOrgs->getOrgs returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

@param {object} options - Optional parameters.

(string)    credential - A public access token with `public_repo` and `read:org` permissions for any GitHub
                         user which limits the responses to the organizations and other query data that this
                         particular user is a member of or has access to currently.

(boolean)   description - Add additional description info for all entries where available; default (false).

(function)  pipeFunction - A function that will be invoked with a single parameter with the transformed result.

(string)    transformType - Overrides current TransformControl transform type.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getOrgs

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getOrgTeams

Transforms all normalized data from GitHubInspectOrgs->getOrgTeams returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

@param {object} options - Optional parameters.

(string)    credential - A public access token with `public_repo` and `read:org` permissions for any GitHub
                         user which limits the responses to the organizations and other query data that this
                         particular user is a member of or has access to currently.

(boolean)   description - Add additional description info for all entries where available; default (false).

(function)  pipeFunction - A function that will be invoked with a single parameter with the transformed result.

(string)    transformType - Overrides current TransformControl transform type.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getOrgTeams

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getOrgTeamMembers

Transforms all normalized data from GitHubInspectOrgs->getOrgTeamMembers returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

@param {object} options - Optional parameters.

(string)    credential - A public access token with `public_repo` and `read:org` permissions for any GitHub
                         user which limits the responses to the organizations and other query data that this
                         particular user is a member of or has access to currently.

(boolean)   description - Add additional description info for all entries where available; default (false).

(function)  pipeFunction - A function that will be invoked with a single parameter with the transformed result.

(string)    transformType - Overrides current TransformControl transform type.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getOrgTeamMembers

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getOwnerOrgs

Transforms all normalized data from GitHubInspectOrgs->getOwnerOrgs returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getOwnerOrgs

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getOwnerRateLimits

Transforms all normalized data from GitHubInspectOrgs->getOwnerRateLimits returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getOwnerRateLimits

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getOwners

Transforms all normalized data from GitHubInspectOrgs->getOwners returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getOwners

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.


####getUserFromCredential

Transforms all normalized data from GitHubInspectOrgs->getUserFromCredential returning the original query data including the transformed results under an added key transformed. In addition if an optional function, pipeFunction, is supplied it is invoked immediately with the transformed results.

@param {object} options - Optional parameters.

(string)    credential - A public access token with `public_repo` and `read:org` permissions for any GitHub
                         user which limits the responses to the organizations and other query data that this
                         particular user is a member of or has access to currently.

(boolean)   description - Add additional description info for all entries where available; default (false).

(function)  pipeFunction - A function that will be invoked with a single parameter with the transformed result.

(string)    transformType - Overrides current TransformControl transform type.

For additional GitHubInspectOrgs options see:

  • https://www.npmjs.com/package/typhonjs-github-inspect-orgs#getUserFromCredential

Please see the various permutations from tests for the transformed data requested for example output:

Returns Promise with an object hash containing normalized, raw and transformed entries.