Skip to content

JavaScript and TypeScript (Node.js)

In order to use the library you need to install Node.js. You can verify this by entering the following command into a terminal:

node --version
# Example output:
# v10.15.0
npm --version
# Example output:
# 6.6.0

Create a new project and switch to that directory by entering the following commands into the terminal (replace example with your desired project directory):

mkdir example
cd example
npm init -y

Then install the library in the project directory:

npm install "@zaber/motion"

Create a file named "example.js" (replace example with your desired file name) to start writing code in JavaScript. Run the script by entering node example.js into a terminal.

Continue the Getting Started guide by running the example code.

Continue the Getting Started guide by initializing the library in your code.

Updating

If you are already using the library and want to update to the latest version, you can do this by entering the following command into a terminal when in the root directory of your project:

npm update "@zaber/motion"

To determine which version of the library you currently have installed, enter the following command into a terminal when in the root directory of your project:

npm list