Thanks to npm:
npm install jsmf-core
Usage and Example
In order to access the most commun JSMF elements use:
const JSMF =Model = JSMFModelClass = JSMFClassEnum = JSMFEnum
Creating a metamodel element (i.e., Class)
Here we created a Class "Family" and a "lastname" attribute. This syntax is inspired by the EMF one.
const Family = ClassFamily
const Person = Class
Now we have the Class "Person" and "Family" let's create a reference between those two Classes.
Creating a model element conforms to a metamodel element.
const john =john firstname = ’ John ’john age = 46
Alternatively you can also use a compact syntax:
const kennedy = Family
You can find examples, discover the other components and test it online with Tonic on JSMF github website (https://js-mf.github.io/#portfolio)