Generates package.json files with sensible defaults.
Implements the npm init functionality — creates a new package.json
with project metadata derived from the current directory or Mix project.
Summary
Functions
Infers project name from the current directory.
Returns default scripts for a new package.
Checks if a package.json already exists in the directory.
Detects if this is an Elixir/Mix project and adjusts defaults.
Generates a default package.json map from the given options.
Generates a minimal package.json (name and version only).
Writes a package.json to disk.
Functions
@spec default_name() :: String.t()
Infers project name from the current directory.
@spec default_scripts() :: map()
Returns default scripts for a new package.
Checks if a package.json already exists in the directory.
Detects if this is an Elixir/Mix project and adjusts defaults.
Generates a default package.json map from the given options.
Generates a minimal package.json (name and version only).
Writes a package.json to disk.