Init
Scaffold new Moddable projects
The default template creates a main.js and minimally configured package.json for running in the simulator.
xs-dev init my-projectManifest
The --manifest flag will create a project with the manifest.json file for Moddable project configuration over the default package.json:
xs-dev init --manifest my-manifest-projectTypeScript
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:
xs-dev init --typescript my-typed-projectIO (ECMA 419)
The --io flag sets up the project to use the TC53 IO manifest in the generated package.json or manifest.json:
xs-dev init --io my-io-projectasyncMain
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.
xs-dev init --asyncMain my-io-projectModdable example
For the --example flag, it can be used as a boolean to select a project from the list of available Moddable examples:
xs-dev init --example my-example-projectOr select from a filtered list of projects:
xs-dev init --example http my-http-projectOr if the complete example name is passed, it will be selected by default:
xs-dev init --example network/mqtt/mqttbasic my-mqtt-projectOverwrite
An existing directory matching the project name can be overwritten with the --overwrite flag:
xs-dev init --overwrite my-existing-project