From 1ffbd561642d05a05e18ada764d50581dea779ef Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Sat, 20 Aug 2022 01:37:05 +0200 Subject: feat: add "deno init" subcommand (#15469) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds an init subcommand to that creates a project starter similar to cargo init. ``` $ deno init my_project Project initialized Run these commands to get started: cd my_project deno run main.ts deno run main_test.ts $ deno run main.ts Add 2 + 3 5 $ cat main.ts export function add(a: number, b: number): number { return a + b; } if (import.meta.main) { console.log("Add 2 + 3", add(2, 3)); } $ cat main_test.ts import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts"; import { add } from "./main.ts"; Deno.test(function addTest() { assertEquals(add(2, 3), 5); }); ``` Co-authored-by: Bartek IwaƄczuk --- cli/tools/mod.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'cli/tools/mod.rs') diff --git a/cli/tools/mod.rs b/cli/tools/mod.rs index 7c5d79744..11c904776 100644 --- a/cli/tools/mod.rs +++ b/cli/tools/mod.rs @@ -4,6 +4,7 @@ pub mod bench; pub mod coverage; pub mod doc; pub mod fmt; +pub mod init; pub mod installer; pub mod lint; pub mod repl; -- cgit v1.2.3