Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: mention package.json can be read from parent directories #1239

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions runtime/fundamentals/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ projects. If you have a Node.js project, it is not necessary to create a
`deno.json` file. Deno will use the `package.json` file to configure the
project.

If both a `deno.json` and `package.json` file are present in the same directory,
Deno will understand dependencies specified in both `deno.json` and
`package.json`; and use the `deno.json` file for Deno-specific configurations.
If both a `deno.json` and `package.json` file are present in the same directory
(or a `package.json` in a parent directory), Deno will understand dependencies
specified in both `deno.json` and `package.json`; and use the `deno.json` file
for Deno-specific configurations.
Read more about
[Node compatibility in Deno](/runtime/fundamentals/node/#node-compatibility).

Expand Down
3 changes: 2 additions & 1 deletion runtime/fundamentals/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ Deno that can remap anything. Learn more about what the import map can do

The installation process is made easy with the `deno add` subcommand. It will
automatically add the latest version of the package you requested to the
`imports` section in `deno.json`.
`imports` section in `deno.json` (unless there's already a `package.json`
file in the current or parent directories).

```sh
# Add the latest version of the module to deno.json
Expand Down
Loading