Init
Scaffold new Moddable projects
The default template creates a main.js
and minimally configured package.json
for running in the simulator.
Manifest
The --manifest
flag will create a project with the manifest.json
file for Moddable project configuration over the default package.json
:
TypeScript
The --typescript
flag will create a project with Moddable types and a main.ts
to get started, as well as the necessary scripts to build the TypeScript before running:
IO (ECMA 419)
The --io
flag sets up the project to use the TC53 IO manifest in the generated package.json
or manifest.json
:
asyncMain
The --asyncMain
flag will enable top-level await (TLA) in your project’s entry file. In XS, TLA is only be available in imported modules by default.
Moddable example
For the --example
flag, it can be used as a boolean to select a project from the list of available Moddable examples:
Or select from a filtered list of projects:
Or if the complete example name is passed, it will be selected by default:
Overwrite
An existing directory matching the project name can be overwritten with the --overwrite
flag: