Installation

How to install and set up the Notations library

Prerequisites

You need Node.js (version 14 or higher) and npm or yarn installed on your system.

Install via npm

npm install notations

Install via yarn

yarn add notations

TypeScript Support

The library is written in TypeScript and includes type definitions. No additional @types packages are needed.

Browser Usage

For browser applications, the library works with modern bundlers like Webpack, Rollup, or Vite:

import * as N from "notations";

// Use the library
const [notation, layout, errors] = N.load(source);

Web Components (Optional)

If you want to use interactive notation components in your web application, install the web-components package:

npm install notations-web notations

This package provides ready-to-use components for rendering notation with the <notation> tag. See the Integration Guide for details.

Verify Installation

Create a simple test file to verify the installation:

// test.js
import * as N from "notations";

const source = "S R G M";
const [notation, layout, errors] = N.load(source);

if (errors.length === 0) {
  console.log("Installation successful!");
  console.log("Notation:", notation);
} else {
  console.error("Errors:", errors);
}

Run it:

node test.js

If you see "Installation successful!", you're ready to go.

Next Steps