-
Notifications
You must be signed in to change notification settings - Fork 0
JavaScript TypeScript
There are multiple runtimes out there for JavaScript/TypeScript development.
Node.js is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts. Node.js is the juggernaut in the JavaScript/TypeScript space.
Its development experience is more piecemeal than other runtimes, so you need to install and manage dependencies for each of the things you want to do while developing.
brew install node
Any of these approaches are valid.
-
Node Version Manager (
nvm
) - Via Homebrew:
brew search node | grep "node@" | sort --version-sort brew install node@{VERSION}
The npm
package manager is developed by GitHub, and comes built-in with Node.js installations. It talks to the npmjs.com package registry by default. It has broad compatibility with all packages in the npmjs.com package registry, but can be slower than alternatives.
npm install
The yarn
package manager is developed by Meta and Google. It talks to the npmjs.com package registry by default. It is faster and more efficient than npm
, but may not be compatible with all packages in the npmjs.com package registry.
corepack use yarn@latest
yarn set version berry
yarn install
The pnpm
package manager talks to the npmjs.com package registry by default. It is faster and more efficient than both npm
and yarn
, but may not be compatible with all packages in the npmjs.com package registry. It also uses less disk space for dependencies.
corepack use pnpm@latest
pnpm install
TypeScript compiler
TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale. The compiler converts well-formed TypeScript into high-quality JavaScript that can be executed by Node.js and the web browser.
npm install --save-dev typescript
yarn add --dev typescript
pnpm install --save-dev typescript
Deno is built on web standards with zero-config TypeScript, unmatched security, and a complete built-in toolchain. The Deno runtime natively supports TypeScript, JSX, and modern ECMAScript features with zero configuration. Deno prioritizes web standard APIs, maximizing code reuse between browser and server and future-proofing your code.
Its development experience is more batteries included by design. The essential tools you need to build, test, and deploy your applications are all included out of the box. It has a strong standard library and compatibility with Node.js APIs and npmjs.com packages.
brew install deno
Always run the latest release.
Deno has a built-in package manager. It has built-in support for both npmjs.com and jsr.io.
deno add npm:typescript@latest # Microsoft TypeScript
deno add jsr:@hono/hono # Cloudflare Hono
Bun is an all-in-one JavaScript runtime and toolkit designed for speed, complete with a bundler, test runner, and Node.js-compatible package manager. Develop, test, run, and bundle JavaScript and TypeScript projects—all with Bun. Bun is designed as a drop-in replacement for Node.js. It natively implements hundreds of Node.js and Web APIs, including fs
, path
, Buffer
and more.
curl -fsSL https://bun.sh/install | bash
Always run the latest release.
Bun has a built-in package manager. It has built-in support for npmjs.com.
bun add --dev typescript # Microsoft TypeScript
bun add hono # Cloudflare Hono