You are viewing documentation generated from a user contribution or an upcoming release. The contents of this document may not have been reviewed by the Deno team. Click here to view the documentation for the latest release.

package.json compatibility

Deno supports resolving dependencies based on a package.json file in the current or ancestor directories. This is similar to how Node.js resolves dependencies. We recommend using import maps with deno.json which is explained here.


  "name": "@deno/my-example-project",
  "description": "An example app created with Deno",
  "type": "module",
  "scripts": {
    "dev": "deno run --allow-env --allow-sys main.ts"
  "dependencies": {
    "chalk": "^5.2"


import chalk from "chalk";

console.log("Hello from Deno!"));

Then we can run this script:

> deno run --allow-env --allow-sys main.ts
Hello from Deno!

Or also execute package.json scripts via deno task:

> deno task dev
Hello from Deno!