<iframe src="https://giphy.com/embed/lZfU9MnEJ4di0" width="480" height="478" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
<iframe src="https://giphy.com/embed/wvQIqJyNBOCjK" width="480" height="387" frameBorder="0" class="giphy-embed" allowFullScreen></iframe> <iframe src="https://giphy.com/embed/5eFp76zhsq3uw" width="480" height="277" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
<iframe src="https://giphy.com/embed/YQitE4YNQNahy" width="480" height="270" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
- An runtime environment for Javascript/Typescript
- Set of tools to help build Javascript/Typescript projects (bundler, compiler, language server, task runner, test runner, REPL, documentation generator, AND more)
- Designed to be edge-native (Netlify wrote their new "Edge Functions" platform on top of Deno)
- An attempt by the original creator of Node (Ryan Dahl) to correct his biggest mistakes when building Node
<iframe src="https://giphy.com/embed/tmQrpA8zpG4a16SSxm" width="480" height="480" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
- Playing with new tools in the web ecosystem can be fun!
- While Deno was not designed specifically for scripts, it's damn good at handling them
- Out-of-the-box Typescript support
- Bundler & compiler included (can compile your scripts down to a single binary if you want!)
- You add the specific version of a package to your dependencies list so that it doesn't break down the line
- Deno's permissions system is well thought out (opt-in to permissions, unlike Node)
- You have access to most of the native Web APIs that you already know and use a lot (Promises,
fetch
, top-levelasync/await
, etc)
In Node
- find a package on https://npmjs.com or via your favorite search engine
- Install the package from your favorite package manager (
npm
,yarn
,pnpm
)npm i better-sqlite3
In Deno
- search for a package on your favorite search engine
- does that package host the version online for you?
- If yes, grab the URL and add it to your dependencies
- If no, check one of https://esm.sh or https://skypack.dev to see if the package is supported with ESM and add their link to your dependencies
In Deno
- most common Deno packages are available on Deno's Third Party Modules hosting platform (https://deno.land/x)
- https://deno.land/#installation has a quick-start guide
- https://deno.land/manual/getting_started/installation has a more detailed explanation
- Homebrew (Mac):
brew install deno
VSCode
- Search for
Deno
orvscode_deno
in the Extensions
- Running:
deno run <path-to-file>
- Compiling to a binary:
deno compile <path-to-file>
Permissions system documentation
All of the different permissions flags you can use:
--allow-env
,--allow-hrtime
,--allow-net
,--allow-ffi
,--allow-read
,--allow-write
,--allow-run
,--allow-all/-A
Configuration file documentation
deno.json
ordeno.jsonc
is supported as a JSON configuration filecompilerOptions
: provides same options as in atsconfig.json
filetasks
: similar to thescripts
in apackage.json
file, instructs Deno's task runner- and more! (
import_map
,lint
,test
,fmt
)
- Browser standard that Deno has now implemented
- Convention in Deno before was to use a
deps.ts
file where you import all of your dependencies, and export them aliased
// deps.ts
export {
Database,
Row,
} from 'https://deno.land/x/sqlite3@0.4.3/mod.ts';
// myProgram.ts
import { Database, Row } from './deps.ts';
- Define our dependencies in a JSON format, give them aliases that we will use in our project
- Keeps firmly-versioned dependencies from the URL like Deno prefers, gives developers easier way to import dependencies in the project with lower mental overhead
<iframe src="https://giphy.com/embed/10fxZavhBFXsUE" width="480" height="349" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
- Package that gives us CLI superpowers in Deno
- Common UI components that we would want to use while building command line interfaces
<iframe src="https://giphy.com/embed/LRVnPYqM8DLag" width="480" height="269" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
- For those of you who prefer GUIs and are on Macs, checkout ScriptKit or Deno WebView
<iframe src="https://giphy.com/embed/W1ecIq4sEofza" width="480" height="270" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
git clone
the repository to $HOME/mtg (your home folder)- configure the
.env
and.env.defaults
files to hold the proper key/value pairs for your zoom and google meet links - run
deno task dev
to run the script!