0.0.72 • Published 4 months ago

mdu.js v0.0.72

Weekly downloads
-
License
LGPL-3.0
Repository
github
Last release
4 months ago

npm.io

Modulo

Modulo is a lightweight framework for creating HTML Web Components: Reusable snippets of HTML, CSS, and JavaScript that create new HTML-like tags that can be used and reused anywhere on your site. Modulo runs entirely in the browser, and can be incorporated with just a couple lines of code into any HTML file (see the "Quick start"), such that no terminal usage is necessary. However, if you prefer, you can also start projects using NPM from the Terminal (see the "NPM start").

  • Beginner-friendly features inspired by React, Svelte, and Vue.js, in only 2000 lines of dependency-free, self-building JavaScript. A “no fuss” drop-in for existing web apps or Jamstack static sites.

  • Try interactive demos and learn more on the website: https://modulojs.org/

Project Status: alpha (Well-documented with lots of examples, but still a work in progress -- help by trying it out!)


Quick start

  1. Include in any HTML file the single Modulo JavaScript file loaded from a CDN:
<script src="https://unpkg.com/mdu.js"></script>
  1. Now define one or more Modulo web components (custom HTML elements). First, use <template Modulo> and </template> to mark where in your HTML you are defining our components. Then, add "Template", "Script", and "Style" tags, to incorporate HTML, JavaScript, and CSS respectively into your component. E.g.:
<template Modulo>
    <Component name="HelloWorld">
        <Template>
            Hello <strong>Modulo</strong> World!
        </Template>
        <Script>
            console.log('Hello Modulo JS world!');
        </Script>
        <Style>
            strong { color: purple; }
        </Style>
    </Component>
</template>
<script src="https://unpkg.com/mdu.js"></script>
  1. Now, you can use and reuse this new custom element wherever you want, just like any normal HTML tag. E.g.:
<x-HelloWorld></x-HelloWorld>
<p>In a P tag: <x-HelloWorld></x-HelloWorld></p>
  • (Optional) Download src/Modulo.js (the single 2000-line file that contains all of the framework) to wherever you put JS files for your website (for example, /static/js/Modulo.js)

NPM start

Prefer command-line tools, such as NPM? Run the following, and follow the on-screen commands:

npm init modulo

License

(C) 2023 - Michael Bethencourt LGPLv3

0.0.72

4 months ago

0.0.71

4 months ago

0.0.70

4 months ago

0.0.69

4 months ago

0.0.68

4 months ago

0.0.67

5 months ago

0.0.65

5 months ago

0.0.66

5 months ago

0.0.62

8 months ago

0.0.63

8 months ago

0.0.64

8 months ago

0.0.61

8 months ago

0.0.60

9 months ago

0.0.59

9 months ago

0.0.51

12 months ago

0.0.52

12 months ago

0.0.53

12 months ago

0.0.54

9 months ago

0.0.55

9 months ago

0.0.56

9 months ago

0.0.57

9 months ago

0.0.58

9 months ago

0.0.50

12 months ago

0.0.40

1 year ago

0.0.41

1 year ago

0.0.42

1 year ago

0.0.43

1 year ago

0.0.44

1 year ago

0.0.46

1 year ago

0.0.47

1 year ago

0.0.37

1 year ago

0.0.38

1 year ago

0.0.39

1 year ago

0.0.36

1 year ago

0.0.48

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.35

1 year ago

0.0.26

1 year ago

0.0.27

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.20

2 years ago

0.0.21

1 year ago

0.0.22

1 year ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago