Getting Started

Quickly get setup to work with Knot.

Starting a New Project

If you will be starting a new knot project, the best option would be to use the provided project generator. It currently supports projects which use react, vue,webpack, browserify and rollup. In order to run the command either install it globally or use it directly with npx.

npm install --global @knot/cli
# or
yarn global add @knot/cli

To start a new project, create a directory for it and run the generator's init command. You will be prompted to choose a type of project as well as answer a couple of questions.

knot init
# or, to skip installation
npx knot init

This command will generate a number of files, most important being the following:

  • .knot.yml - configuration file for the knot compiler

  • src/index.js - the javascript entry point

  • src/index.kn - the knot application entry point

A development server can be started by running the package's start command:

npm start
# or
yarn start

The code can also be bundled by webpack into minified javascript and html:

npm build
# or
yarn build

Last updated