parse-author 0.1.1

Parse an npm-style author string "Name <email> (url)" into its name, email, and url. A faithful port of the parse-author npm package. Zero dependencies, no_std.
Documentation
# parse-author

[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)

[![Crates.io](https://img.shields.io/crates/v/parse-author.svg)](https://crates.io/crates/parse-author)
[![Documentation](https://docs.rs/parse-author/badge.svg)](https://docs.rs/parse-author)
[![CI](https://github.com/trananhtung/parse-author/actions/workflows/ci.yml/badge.svg)](https://github.com/trananhtung/parse-author/actions/workflows/ci.yml)
[![License](https://img.shields.io/crates/l/parse-author.svg)](#license)

**Parse an npm-style author string** — `"Name <email> (url)"` — into its `name`,
`email`, and `url`. The format used by `package.json` `author`/`contributors`
fields. A faithful Rust port of the
[`parse-author`](https://www.npmjs.com/package/parse-author) npm package (and the
`author-regex` it is built on). Zero dependencies and `#![no_std]`.

```rust
use parse_author::parse_author;

let a = parse_author("Jon Schlinkert <jon@example.com> (https://github.com/jonschlinkert)");
assert_eq!(a.name.as_deref(), Some("Jon Schlinkert"));
assert_eq!(a.email.as_deref(), Some("jon@example.com"));
assert_eq!(a.url.as_deref(), Some("https://github.com/jonschlinkert"));

assert_eq!(parse_author("Jane Doe").name.as_deref(), Some("Jane Doe"));
assert_eq!(parse_author("<me@example.com>").email.as_deref(), Some("me@example.com"));
```

## Why parse-author?

Tooling that reads `package.json` — license checkers, SBOM generators, registry
mirrors, JS-build-tool ports — needs to pull the name, email, and homepage out of an
author string. The shape is simple but has corners (each part optional, brackets
decide the field), and this matches the canonical JS parser exactly.

```toml
[dependencies]
parse-author = "0.1"
```

## API

| Item | Purpose |
| --- | --- |
| `parse_author(input)` | Parse into an `Author` |
| `Author { name, email, url }` | Each an `Option<String>`, present only when found |

## Behavior

- The `name` is everything before the first `<` or `(`, trimmed.
- A `<…>` segment is the `email`; a `(…)` segment is the `url` (the opening bracket
  decides the field — `<…)` still parses as an email).
- An input with no word character, or one that doesn't fit the `Name <email> (url)`
  shape (an unterminated bracket, trailing junk), yields an empty `Author`.

## Contributors ✨

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome — code, docs, bug reports, ideas, reviews! See the [emoji key](https://allcontributors.org/docs/en/emoji-key) for how each contribution is recognized, and open a PR or issue to get involved.

Thanks goes to these wonderful people:

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tbody>
    <tr>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/trananhtung"><img src="https://avatars.githubusercontent.com/u/30992229?v=4?s=100" width="100px;" alt="Tung Tran"/><br /><sub><b>Tung Tran</b></sub></a><br /><a href="https://github.com/trananhtung/parse-author/commits?author=trananhtung" title="Code">💻</a> <a href="#maintenance-trananhtung" title="Maintenance">🚧</a></td>
    </tr>
  </tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

## License

Licensed under either of [Apache-2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT) at
your option.