Skip to main content
On this page

deno create

The deno create command scaffolds a new project from a template package. It works with both JSR and npm packages that provide project templates.

Usage Jump to heading

>_
deno create [OPTIONS] [PACKAGE] [-- [ARGS]...]

By default, unprefixed package names are resolved from JSR. You can use the npm: or jsr: prefix to be explicit, or use the --npm / --jsr flags.

How it works Jump to heading

Package resolution differs between npm and JSR:

  • npm packages use the create- naming convention. Running deno create npm:vite resolves to the create-vite package on npm and executes its main entry point.
  • JSR packages use the ./create export. Any JSR package can act as a template by defining a ./create entry point in its deno.json:
deno.json
{
  "name": "@my-scope/my-template",
  "version": "1.0.0",
  "exports": {
    ".": "./mod.ts",
    "./create": "./create.ts"
  }
}

When you run deno create @my-scope/my-template, Deno looks for the ./create export and runs it as the scaffolding script.

Examples Jump to heading

Create a project from a JSR package:

>_
deno create @fresh/init

Create a project from an npm package:

>_
deno create npm:vite my-app

Using the --npm flag to treat unprefixed names as npm packages:

>_
deno create --npm create-vite my-app

Pass arguments to the template package:

>_
deno create @fresh/init -- --force

Flags Jump to heading

  • --npm - Treat unprefixed package names as npm packages
  • --jsr - Treat unprefixed package names as JSR packages (default)
  • -y, --yes - Bypass the prompt and run with full permissions
Command line usage:
deno create [OPTIONS] [PACKAGE] [-- [ARGS]...]

scaffolds a project from a package

Options Jump to heading

Treat unprefixed package names as JSR packages.

Treat unprefixed package names as npm packages.

Bypass the prompt and run with full permissions.

Last updated on

Did you find what you needed?

Privacy policy