Appearance
Installation
Ogma is available in two versions:
- ogma.mjs standard version
- ogma.dev.mjs development version
- ogma.js for legacy browsers/environments
The standard version is optimized for production use, while the development version includes additional debugging features.
Client-side
Ogma is compatible with module loaders and advanced front-end javascript frameworks. Please refer to the tutorials for more information.
If you wish to use Ogma within an application that uses a module loader or a NodeJS environment, we suggest you adding it as a dependency to your project. This can be done in two ways:
Using npm/pnpm/yarn
If you are developing locally and can access the outside Internet you can also install directly. Your API key is required to install the library, so make sure you have it ready. You can find it in your Linkurious account, same as the full npm
install link.
sh
# NPM
npm install --save https://get.linkurio.us/api/get/npm/ogma/<VERSION>/?secret=<YOUR_API_KEY>
sh
# note the quotes around the URL, they are required for yarn to parse it correctly
yarn add "https://get.linkurio.us/api/get/npm/ogma/<VERSION>/?secret=<YOUR_API_KEY>"
sh
# same as npm)
pnpm install --save https://get.linkurio.us/api/get/npm/ogma/<VERSION>/?secret=<YOUR_API_KEY>
If you cannot use npm
from external sources, because of company policy, you can always install it via tar.gz
.
Using downloaded tar.gz
The same link used for the npm
version can be used to download a tar.gz
file: just past it into your browser to download the file. Once downloaded it is possible to tell npm
to use it to install locally:
sh
npm install --save path/to/ogma-v.X.X.X.tar.gz
Single HTML page
Download Ogma as ogma.zip archive from get.linkurio.us and extract it in your project folder. In your HTML page point to the ogma.js
file.
In single-page applications, Ogma can be imported as a script:
html
<!-- Import Ogma -->
<script src="path/to/ogma.js"></script>
ES module
Ogma is compatible with the UMD format and can be used also with the new ES module format
js
import Ogma from '@linkurious/ogma';
Server-side
Ogma can be used in a Node.js server using the CommonJS convention:
ts
// if you installed Ogma via npm CLI
import Ogma from '@linkurious/ogma';
// of if you downloaded the js file manually
import Ogma from 'path/to/ogma.js';