Home / Function/ getName() — astro Function Reference

getName() — astro Function Reference

Architecture documentation for the getName() function in messages.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  c7a629b4_9a8f_8df4_a554_8dc9c11f29bf["getName()"]
  7e47cce3_632a_b102_4402_d13baf44fc8e["messages.ts"]
  c7a629b4_9a8f_8df4_a554_8dc9c11f29bf -->|defined in| 7e47cce3_632a_b102_4402_d13baf44fc8e
  style c7a629b4_9a8f_8df4_a554_8dc9c11f29bf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/create-astro/src/messages.ts lines 39–52

export const getName = () =>
	new Promise<string>((resolve) => {
		exec('git config user.name', { encoding: 'utf-8' }, (_1, gitName) => {
			if (gitName.trim()) {
				return resolve(gitName.split(' ')[0].trim());
			}
			exec('whoami', { encoding: 'utf-8' }, (_3, whoami) => {
				if (whoami.trim()) {
					return resolve(whoami.split(' ')[0].trim());
				}
				return resolve('astronaut');
			});
		});
	});

Domain

Subdomains

Frequently Asked Questions

What does getName() do?
getName() is a function in the astro codebase, defined in packages/create-astro/src/messages.ts.
Where is getName() defined?
getName() is defined in packages/create-astro/src/messages.ts at line 39.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free