Skip to content

Commit dbb9e71

Browse files
committed
chore: init
0 parents  commit dbb9e71

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.env
2+
node_modules

Diff for: deno.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"tasks": {
3+
"dev": "deno run --watch index.ts"
4+
},
5+
"imports": {
6+
"@std/assert": "jsr:@std/assert@1"
7+
},
8+
"lint": {
9+
"include": ["src/"],
10+
"exclude": ["test/"],
11+
"rules": {
12+
"tags": ["recommended"]
13+
}
14+
},
15+
"fmt": {
16+
"lineWidth": 109,
17+
"useTabs": true,
18+
"semiColons": true,
19+
"singleQuote": false,
20+
"indentWidth": 2
21+
}
22+
}

Diff for: src/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export function add(a: number, b: number): number {
2+
return a + b;
3+
}
4+
5+
// Learn more at https://docs.deno.com/runtime/manual/examples/module_metadata#concepts
6+
if (import.meta.main) {
7+
console.log("Add 2 + 3 =", add(2, 3));
8+
}

Diff for: src/index_test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { assertEquals } from "@std/assert";
2+
import { add } from "./main.ts";
3+
4+
Deno.test(function addTest() {
5+
assertEquals(add(2, 3), 5);
6+
});

0 commit comments

Comments
 (0)