Monster
Monster is perfectly suited for the creation of beautiful and fast
user interfaces and websites.
Monster relies on proven concepts mixed with many new JavaScript concepts such as
classes, WeakRef, WeakMaps, proxies or the MutationObserver interface, just to name a few.
Monster integrates easily into your existing websites without taking over everything.
It is not the goal of Monster to pull in an entirely new abstraction
with its own language, but to combine the existing techniques of HTML,
CSS and JavaScript in a meaningful way.
One design target is to reach the shiny sun with as little JavaScript as possible.
Monster was built with ES6 modules and uses import
and export.
For some functions, you need additional polyfills.
Documentation
To check out docs and examples, visit monsterjs.org/en/doc/monster/.
Installation
npm install @schukai/monster
, yarn install @schukai/monster
or pnpm install @schukai/monster
Usage
A simple example of the use of functionality from Monster. We create a small file index.mjs
.
The m
in .mjs
stands for module. In the example we want to make substitutions in a string.
import {Formatter} from '@schukai/monster/source/text/formatter.mjs';
const text = '${mykey${subkey}}';
let obj = {
mykey2: "1",
subkey: "2"
};
new Formatter(obj).format(text);
To integrate this function into a website it is recommended to use a bundler like esbuild.
esbuild index.mjs --outfile dist.js
We can now integrate that into our website.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Monster</title>
<script src="dist.js"></script>
</head>
<body>
Voila!
Polyfill
We do try to work around some browser bugs, but on the whole we don't use polyfills and feature detection.
However, many functions can be mapped via polyfill.io and thus the compatibility can be increased.
<script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.map,Array.prototype.reduce,Array.prototype.sort,ArrayBuffer,atob,DataView,document,DocumentFragment,Element,Event,globalThis,HTMLDocument,HTMLTemplateElement,JSON,Map,Math.log2,Number.isInteger,Object.assign,Object.defineProperty,Object.entries,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.keys,Promise,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,Set,String.prototype.endsWith,String.prototype.matchAll,String.prototype.padStart,String.prototype.startsWith,String.prototype.trim,Symbol,Symbol.iterator,WeakMap,WeakSet"
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
Questions
For questions and commercial support, please contact schukai GmbH.
The issue list of this repo is exclusively for bug reports and feature requests.
Issues
Please make sure to read the Issue Reporting Checklist before opening an
issue. Issues not conforming to the guidelines may be closed immediately.
License
Copyright © 2022 schukai GmbH
AGPL
You can also purchase a commercial license.
Changelog
Detailed changes for each release are documented in
the CHANGELOG.