Skip to content

Main content

Package JSON Person String Fields

Format explicit package-person fields as name, optional email, and optional URL without validating contact ownership.

Loading tool…

Description

Format supplied package-person fields as a name, email and URL string.

Development metadata distinguishes source-map deltas, package-person formatting, executable shorthand and Git object modes. A string with package-like syntax need not satisfy the complete registry or package contract. Formatting a person, extracting a command name or mapping a mode does not inspect files or modify a repository.

Format supplied package-person fields as a name, email and URL string.

When to use this tool

Use Package JSON Person String Fields when you already have name, email, url and need to format supplied package-person fields as a name, email and URL string.

How to use the tool and how it works

  1. Enter name, email, url. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read personString. Use the output convention below.

Require name nonempty; forbid angle brackets, parentheses, CR and LF in every field. Append nonempty email as an angle-bracket field and nonempty URL in parentheses.1

Person metadata can use a combined name, email and URL string. This formatter only constructs that representation and does not verify the contact fields or package metadata.2

Input fieldMeaning and unitsAccepted input
nameNameRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 8192.
emailOptional empty text; delimiters and line breaks are screened but email syntax is not validated.Required. Text; maximum UTF-16 length 8192.
urlOptional empty text; no URL parsing or endpoint check.Required. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
personStringPerson StringRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "name": "A. Maintainer",
    "email": "a@example.test",
    "url": "https://example.test"
  },
  "output": {
    "personString": "A. Maintainer \u003ca@example.test> (https://example.test)"
  }
}

Limitations and assumptions

  • Spaces and many other characters are accepted. No email, URL, person, npm metadata schema, package ownership or contact information is validated.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Validate the full source map, package metadata or Git object when conformance matters. Use the relevant complete format and actual file/object information; a local delta or grammar check does not establish a valid package, executable, source mapping or tree entry.

References

  1. Calculation and input contract: development/package-json-person-string-fields — tool.io

  2. npm package.json: People fields — npm

Similar or alternative tools