Skip to content

Commit

Permalink
docs: Update creating-a-package-json-file.mdx (#1290)
Browse files Browse the repository at this point in the history
Induce minor readability changes:
- Provide example for website in "author" parameter
- Add description in package.json code example as advised in the
documentation
- Highlight & edit npm init command
  • Loading branch information
kenshanta authored Sep 25, 2024
1 parent baadf82 commit eda158e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Your Name <[email protected]> (http://example.com)
{
"name": "my-awesome-package",
"version": "1.0.0",
"author": "Your Name <[email protected]>"
"author": "Your Name <[email protected]> (http://example.com)"
}
```

Expand Down Expand Up @@ -116,7 +116,7 @@ Wrote to /home/monatheoctocat/my_package/package.json:
{
"name": "my_package",
"description": "",
"description": "make your package easier to find on the npm website",
"version": "1.0.0",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -139,7 +139,7 @@ Wrote to /home/monatheoctocat/my_package/package.json:

- `name`: the current directory name
- `version`: always `1.0.0`
- `description`: info from the README, or an empty string `""`
- `description`: info about the package, or an empty string `""`
- `scripts`: by default creates an empty `test` script
- `keywords`: empty
- `author`: empty
Expand All @@ -149,7 +149,7 @@ Wrote to /home/monatheoctocat/my_package/package.json:

### Setting config options for the init command

You can set default config options for the init command. For example, to set the default author email, author name, and license, on the command line, run the following commands:
You can set default config options for the `npm init` command. For example, to set the default author email, author name, and license, on the command line, run the following commands:

```
> npm set init-author-email "[email protected]"
Expand Down

0 comments on commit eda158e

Please sign in to comment.