# list_org_published_modules

> A CLI tool that lists all the modules published by a given GitHub organization for a given ecosystem (npm, maven, ect.)

Latest version **0.0.2** (published 2021-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install list_org_published_modules
pnpm add list_org_published_modules
yarn add list_org_published_modules
bun add list_org_published_modules
```

Provides the command `list_org_published_modules`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2021-07-24 |
| First published | 2021-07-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 54.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | u/garronej |
| Maintainers | garronej |
| Keywords | etalab, npm, GitHub |

## Links

- npm: https://www.npmjs.com/package/list_org_published_modules
- Repository: https://github.com/garronej/list_org_published_modules
- Issues: https://github.com/garronej/list_org_published_modules/issues
- npm.io page: https://npm.io/package/list_org_published_modules

## Dependencies (5)

- [evt](https://npm.io/package/evt.md) 2.0.0-beta.27
- [tsafe](https://npm.io/package/tsafe.md) ^0.4.1
- [url-join](https://npm.io/package/url-join.md) ^4.0.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1
- [@octokit/rest](https://npm.io/package/@octokit/rest.md) ^18.7.1

## Recent versions

- 0.0.2 (latest) — 2021-07-24
- 0.0.1 — 2021-07-24

## README

<p align="center">
    <img src="https://user-images.githubusercontent.com/6702424/126882975-441bc414-f3cc-45ba-ad7a-72208945678f.png">  
</p>
<p align="center">
    <i>Lists all the modules published by a given GitHub organization for a given ecosystem (npm, maven, ect.)</i>
    <br>
    <br>
    <img src="https://github.com/garronej/list_org_published_modules/workflows/ci/badge.svg?branch=main">
    <img src="https://img.shields.io/bundlephobia/minzip/list_org_published_modules">
    <img src="https://img.shields.io/npm/dw/list_org_published_modules">
    <img src="https://img.shields.io/npm/l/list_org_published_modules">
</p>
<p align="center">
  <a href="https://garronej.github.io/list_org_published_modules/">Try it!</a>
</p>

This tool take as input a GitHub organization or GitHub user name and list the modules
it publishes on the major package manager repository: npm, maven, ect.

Note that it isn't a simple database query or API request, thus it is meant to be run
periodically or triggered by webhooks.

**As of now this module ony works with NPM**

# Run as a CLI tool

Example with [Etalab](https://github.com/Etalab)

```bash
$ npx list_org_published_modules etalab --verbose
```

output (after ~4minutes):

```jsonc
[
    {
        "repoName": "codes-postaux",
        "modules": [
            {
                "type": "npm",
                "moduleName": "codes-postaux",
                "packageJsonDirPath": "/"
            }
        ]
    },
    {
        "repoName": "monuments-historiques",
        "modules": [
            {
                "type": "npm",
                "moduleName": "@sgmap/monuments-historiques",
                "packageJsonDirPath": "/"
            }
        ]
    },
    {
        "repoName": "api-geo",
        "modules": [
            {
                "type": "npm",
                "moduleName": "@etalab/api-geo",
                "packageJsonDirPath": "/"
            }
        ]
    }
    //...Many more entries
]
```

If you run the tools multiple times you will soon reach the GitHub API rate limit.
To fix it, [create a GitHub Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) and provide it as the environnement variable `GITHUB_TOKEN` when you run the build tool.

# Use it in a Node or a Web project.

```bash
npm install list_org_published_modules
```

```typescript
import {
    createOctokit,
    listGitHubOrganizationPublishedModulesFactory,
} from "list_org_published_modules";
//On the browser fetch is defined on window.fetch you don't need to import it.
import fetch from "node-fetch";

const githubOrganizationName = process.argv[2];

const { listGitHubOrganizationPublishedModules } = listGitHubOrganizationPublishedModulesFactory({
    ...createOctokit({ "github_token": undefined }),
    fetch,
});

const { evtRepoModules } = listGitHubOrganizationPublishedModules({ githubOrganizationName });

evtRepoModules.attach(console.log);
```

NOTE: The result are dispatched via an [Evt](https://github.com/garronej/evt)

# Development

The test app source code is located on the [test-app branch](https://github.com/garronej/list_org_published_modules/tree/test-app) and deployed via [this workflow](https://github.com/garronej/list_org_published_modules/blob/main/.github/workflows/deploy-test-app.yaml)

---
_Source: https://npm.io/package/list_org_published_modules · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
