new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Deno · all subjects

cli/install

23 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

deno install installs tool globally as command

To make a script available as a command on your own machine without compiling, install it globally with deno install: deno install --global --name greet greet.ts followed by greet --name=Deno

Switch back to stable channel

To switch back to the stable channel from canary, run: deno upgrade

Upgrade to latest canary

To upgrade to the latest canary release, run: deno upgrade --canary

Upgrade to specific canary commit

To update to a specific canary, pass the commit hash in the --version option. Example: deno upgrade --canary --version=973af61d8bb03c1709f61e456581d58386ed4952

deno install adds dependencies from npm and JSR

The 'deno install' command adds packages from npm (e.g., 'deno install express') or JSR (e.g., 'deno install jsr:@std/assert'). These can then be imported as ES modules.

Use deno install to replace npm install

Run deno install in a Node.js project directory to read the existing package.json, resolve the same npm packages, and write a node_modules directory just like npm install does.

Node to Deno equivalents for dependencies and scripts

Node and Deno command equivalents: npm install or npm i is deno install, npm install -g <pkg> is deno install -g <pkg>, npm run <script> is deno task <script>, and npm explain <pkg> is deno why <pkg>.

Deno does not run npm lifecycle scripts by default

Deno does not run npm lifecycle scripts (postinstall, install scripts) by default. To allow lifecycle scripts, use deno install --allow-scripts=npm:<pkg> per package or manage approvals with deno approve-scripts.

deno approve-scripts command

The `deno approve-scripts` command manages npm lifecycle script approvals interactively. Scripts only execute when a `node_modules` directory is in use.

deno ci command

The `deno ci` command performs a clean, lockfile-strict install similar to `npm ci`. It errors if `deno.lock` is missing or out of date instead of silently resolving new versions. With `--prod`, it additionally skips devDependencies.

deno publish command

The `deno publish` command publishes a package to JSR.

deno pack command

The `deno pack` command builds an npm-compatible tarball from a Deno package.

deno uninstall command

The `deno uninstall` command removes a globally installed tool.

deno clean command

The `deno clean` command removes the global module cache.

deno install command

The `deno install` command installs the project's dependencies from deno.json or package.json. It can also install tools globally with the `-g` flag.

Version specifier syntax for dependencies

Version ranges use semver notation. Exact version: `1.2.3`. Caret `^1.2.3` allows updates that don't change the leftmost non-zero digit (e.g., `1.2.4` and `1.3.0` allowed, but not `2.0.0`). Tilde `~1.2.3` allows patch updates only (e.g., `1.2.4` allowed, but not `1.3.0`). Comparison operators: `>=1.2.3`, `<=1.2.3`, `>1.2.3`, `<1.2.3`. Wildcards: `1.2.x` for any patch version, `1.x` for any minor/patch, `*` for any version.

deno add command

The `deno add` command adds a new dependency to the project's config file. Unprefixed names are treated as npm packages. JSR packages are prefixed with `jsr:`. After adding, dependencies can be imported by their bare name.

deno remove command

The `deno remove` command removes a dependency from the project's config file.

deno outdated command

The `deno outdated` command lists all dependencies that have newer versions available without making any changes.

deno update command

The `deno update` command updates dependencies to newer versions. With `--latest`, it ignores semver ranges and upgrades to the newest releases available.

deno why command

The `deno why` command explains why a package is in your dependency tree by printing every dependency path that leads to it.

deno info command

The `deno info` command shows a module's full dependency graph, including sizes and cache locations. It can be used on entry points or any specifier.

deno audit command

The `deno audit` command checks installed dependencies against vulnerability databases. It supports `--level=high` to only show high and critical severity vulnerabilities, `--fix` to upgrade affected packages automatically, and `--socket` to check against the socket.dev database.

Give your agent this brain