Install
INFO
Vif requires Nodejs v20+
WARNING
Vif uses tsx to compiles Typescript code. There's a chance that tsx breaks depending on how node is configured on your machine.
init-vif
Vif provides a npx package which will set up a fresh dev environment.
npx init-vif
Usage:
npx init-vif [outDir] --overwrite-dir
┌ Generating Vif project in [outDir]
│
◇ Project Name:
│ My Project
│
◇ Provider:
│ ○ Standard
│ ○ S7-1200
│ ○ S7-1500
│
◇ Options:
│ ○ Ui - Plc simulation in browser (will be added to task main)
│ ○ node-watch - Watch for file changes (will be added to task main)
│ ○ Vitest - Unit test framework
│
If the provider you have chosen do not have a corresponding URL protocol installed, a warning will be raised.
For security reasons, init-vif will not download any executable file, check Agents.
Once you have generated your project, you should see the following structure:
├── tasks
│ └── main.js
│
├── code
│ └── main.ts
│
├── tests
│ └── main.test.ts
│
└── package.json
- main.js see Task Runner.
- main.ts see Providers.
- main.test.ts see Vitest Integration.
By default, init-vif will create all internal imports of the provider in your package.json.
Since all imports have to be the same on all providers, you can copy and paste all the code examples of this documentation safely.
update-vif
Use this package to update all @vifjs
related packages automatically.
npx init-vif
update-vif will start an install
script if a lock file of a specific manager is found.
If you are using a workspace, you will have to trigger install
manually.
Others
All other packages which are not installed by init-vif have a dedicated page for installation / explanation: