Used to create a template Marko project in a specific directory.
# Creates a Marko project
npm init marko
# Creates a project called "myapp" from the "webpack" example template
npm init marko myapp -- --template webpack
yarn create marko
pnpx @marko/create
--dir
: Provide a different directory to setup the project in (default topwd
).--template
: The name of an example from marko-js/examples.- An example name
webpack rollup
- A tag/branch/commit other than
master
is supportedbasic#next # example branch webpack#v1.2.3 # repo release tag rollup#62e9fb1 # repo commit hash
- An example name
--installer
: Override the package manager used to install dependencies. By default will determine from create command and fallback tonpm
.-
marko-create --installer pnpm
-
npm install @marko/create
import { join } from "path";
import create from "@marko/create";
create({
dir: join(__dirname, "myapp")
}).then(() => {
// Project as been created and dependencies installed.
console.log("Project created");
});
Options are the same as the CLI options.