Skip to content

Commit 3ce8195

Browse files
committed
docs: regroup Node-to-Deno cheatsheet by purpose with framing
1 parent 16d4412 commit 3ce8195

1 file changed

Lines changed: 50 additions & 24 deletions

File tree

runtime/fundamentals/migrate_from_node.md

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -53,27 +53,53 @@ deno task start
5353

5454
## Node to Deno Cheatsheet
5555

56-
| Node.js | Deno |
57-
| -------------------------------------- | ----------------------------- |
58-
| `node file.js` | `deno file.js` |
59-
| `ts-node file.ts` | `deno file.ts` |
60-
| `nodemon` | `deno run --watch` |
61-
| `node -e` | `deno eval` |
62-
| `npm i` / `npm install` | `deno install` |
63-
| `npm install -g` | `deno install -g` |
64-
| `npm run` | `deno task` |
65-
| `eslint` | `deno lint` |
66-
| `prettier` | `deno fmt` |
67-
| `package.json` | `deno.json` or `package.json` |
68-
| `tsc` | `deno check` ¹ |
69-
| `typedoc` | `deno doc` |
70-
| `jest` / `ava` / `mocha` / `tap` / etc | `deno test` |
71-
| `nexe` / `pkg` | `deno compile` |
72-
| `npm explain` | `deno info` |
73-
| `nvm` / `n` / `fnm` | `deno upgrade` |
74-
| `tsserver` | `deno lsp` |
75-
| `nyc` / `c8` / `istanbul` | `deno coverage` |
76-
| benchmarks | `deno bench` |
77-
78-
¹ Type checking happens automatically, TypeScript compiler is built into the
79-
`deno` binary.
56+
In a Node project, many of these are separate packages you install and configure
57+
— eslint, prettier, jest, ts-node, nodemon, nyc, tsc. In Deno they're the same
58+
binary, with no extra dependencies and no config files to maintain. You can keep
59+
your existing `package.json`, or move configuration into `deno.json`.
60+
61+
### Run and watch
62+
63+
| Node.js | Deno |
64+
| ----------------- | ------------------ |
65+
| `node file.js` | `deno file.js` |
66+
| `ts-node file.ts` | `deno file.ts` |
67+
| `node -e "…"` | `deno eval "…"` |
68+
| `nodemon` | `deno run --watch` |
69+
70+
### Dependencies and scripts
71+
72+
| Node.js | Deno |
73+
| ----------------------- | ----------------------- |
74+
| `npm install` / `npm i` | `deno install` |
75+
| `npm install -g <pkg>` | `deno install -g <pkg>` |
76+
| `npm run <script>` | `deno task <script>` |
77+
| `npm explain <pkg>` | `deno why <pkg>` |
78+
79+
### Quality and testing — built in, no install or config
80+
81+
| Node.js | Deno |
82+
| -------------------------------- | --------------- |
83+
| `eslint` | `deno lint` |
84+
| `prettier` | `deno fmt` |
85+
| `jest` / `mocha` / `ava` / `tap` | `deno test` |
86+
| `nyc` / `c8` / `istanbul` | `deno coverage` |
87+
| benchmark libraries | `deno bench` |
88+
89+
### TypeScript, docs, and builds
90+
91+
| Node.js | Deno |
92+
| -------------- | -------------- |
93+
| `tsc` | `deno check` ¹ |
94+
| `typedoc` | `deno doc` |
95+
| `nexe` / `pkg` | `deno compile` |
96+
97+
¹ TypeScript runs directly — there's no build step. `deno check` type-checks
98+
without emitting, and the compiler is built into the `deno` binary.
99+
100+
### Toolchain
101+
102+
| Node.js | Deno |
103+
| ------------------- | -------------- |
104+
| `tsserver` | `deno lsp` |
105+
| `nvm` / `n` / `fnm` | `deno upgrade` |

0 commit comments

Comments
 (0)