Starting with a sketch
Start quickly with minimal fuss.
Here are two starting sketches you can choose:
Blank sketch (Github Codespace)
- Uses Typescript
- NPM & bundler for adding additional packages
Blank sketch with Websockets (Glitch)
- NPM for adding additional packages
- Set up with a Node.js websocket server
-
Create a folder for your sketch, open the folder in VS Code
-
Create a basic HTML file named
index.html
, for example:<!doctype html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>hello</title><script type="importmap">{ "imports": { "ixfx/": "https://unpkg.com/ixfx/dist/" } } </script></head><body><script src="script.js" type="module"></script></body></html>Note the
<script>
tag after the title. This is an import map and important to have. -
Create a Javascript file, saving as
script.js
, for exampleimport * as Random from 'ixfx/random.js';console.log(`Hello ${Random.float()}`); -
Serve the folder using Five/Live-Server extension in VS Code.