# find-npm-by-author

> Looks for local NPM packages by their author or URL

Latest version **0.0.4** (published 2022-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install find-npm-by-author
pnpm add find-npm-by-author
yarn add find-npm-by-author
bun add find-npm-by-author
```

Provides the command `find-npm-by-author`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2022-03-20 |
| First published | 2022-03-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 1 |
| Unpacked size | 11.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ferdinand Prantl |
| Maintainers | prantlf |
| Keywords | find, author, npm, security, politics |

## Links

- npm: https://www.npmjs.com/package/find-npm-by-author
- Repository: https://github.com/prantlf/find-npm-by-author
- Homepage: https://github.com/prantlf/find-npm-by-author#readme
- Issues: https://github.com/prantlf/find-npm-by-author/issues
- npm.io page: https://npm.io/package/find-npm-by-author

## Dependencies (1)

- [tiny-glob](https://npm.io/package/tiny-glob.md) ^0.2.9

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2022-03-20
- 0.0.3 — 2022-03-20
- 0.0.2 — 2022-03-20
- 0.0.1 — 2022-03-20

## README

# find-npm-by-author

[![Latest version](https://img.shields.io/npm/v/find-npm-by-author)
 ![Dependency status](https://img.shields.io/librariesio/release/npm/find-npm-by-author)
](https://www.npmjs.com/package/find-npm-by-author)

Looks for local NPM packages by their author or URL. Can be used to detect packages of authors, whose work you want to fund, or who you want to avoid.

## Synopsis

Find all packages installed in the local `node_modules` authored by me, or with `prantlf` in the repository URL:

    npx find-npm-by-author -A prantl -R prantlf

And the same programmatically:

```js
import { findByAuthor } from 'find-npm-by-author'
const { directories } = await findByAuthor({ authors: ['prantl'], repositories: ['prantlf'] })
for (const directory of directories) console.log(directory)
```

## Installation

The command-line tool is usually installed globally. The package can be installed locally too for the programmatic usage. You can use your favourite package manager like [NPM], [PNPM] or [Yarn]. Make sure, that you use [Node.js] version 10 or newer:

```sh
npm i find-npm-by-author
pnpm i find-npm-by-author
yarn add find-npm-by-author
```

## Command Line

Paths to directories paths with matching packages will be printed on the console.

    find-npm-by-author [option...]

    Options:
      -A|--author <word>      word to match in the name of the author
      -H|--homepage <word>    word to match in the home page URL
      -R|--repository <word>  word to match in the repository or bugs URL
      -p|--path <path>        path to modules to search (default: node_modules)
      -V|--version            print version number
      -h|--help               print usage instructions

    Words will be matched as expressions with a word boundary, enclosed by \b.
    The arguments can be specified multiple times to try one of several words.

## API

This package exposes the following names exports.

### findByAuthor({ path, authors, homepages, repositories }): result[]

Input parameters are expected as an object with the following properties. At least one of the arrays `authors`, `homepages` or `repositories` must not be empty.

| property       | type       | default          | description                                                 |
|:---------------|:-----------|:-----------------|:------------------------------------------------------------|
| `path`         | `string`   | `'node_modules'` | path to the directory with NPM modules to search            |
| `authors`      | `string[]` | `[]`             | word expressions to match in names of package authors       |
| `homepages`    | `string[]` | `[]`             | word expressions to match in the package home page URL      |
| `repositories` | `string[]` | `[]`             | word expressions to match in package repository or bug URLs |

Output is an object with the following properties:

| property       | type       | description                             |
|:---------------|:-----------|:----------------------------------------|
| `directories`  | `string[]` | directory paths with matching packages  |
| `errors`       | `object[]` | errors from reading or parsing packages |

An error is described by an object with the following properties:

| property  | type     | description                                                               |
|:----------|:---------|:--------------------------------------------------------------------------|
| `error`   | `Error`  | the original error thrown when reading or parsing a package               |
| `file`    | `string` | the path to the file which was processed when the error was thrown        |
| `content` | `string` | the content of the processed file if reading succeeded and parsing failed |

## Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Lint and test your code.

## License

Copyright (c) 2022 Ferdinand Prantl

Licensed under the MIT license.

[Node.js]: http://nodejs.org/
[NPM]: https://www.npmjs.com/
[PNPM]: https://pnpm.io/
[Yarn]: https://yarnpkg.com/

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