5.1.5 • Published 10 months ago

@crispcode/modux v5.1.5

Weekly downloads
15
License
SEE LICENSE IN LI...
Repository
github
Last release
10 months ago

MODUX

A framework used in front end application creation

Getting started

You can should checkout the Documentation before getting started with MODUX.

Installation

npm install @crispcode/modux --save-dev

You can also create a basic project structure without the need to install modux, by using the npx command:

npx --package=@crispcode/modux -c "modux boilerplate basic create"

How to use

Modux has the following commands available from the command line: Command|Description -|- modux start | Starts the local modux project in development mode modux build | Compiles the project for production. Output will be in the build directory modux boilerplate | Provides information on modux boilerplate. This is used to create project structures based on a template

Add to your package.json scripts:

  "scripts": {
    "start": "modux start",
    "build": "modux build"
  }

To run use: npm start or npm run build

Polyfill

In order to support older versions of browsers, you can use polyfill.io

Modux classes

NameUsageDescription
Routerimport { Router } from '@crispcode/modux'A static class used to manipulate states and urls
Componentimport { Component } from '@crispcode/modux'The Component class. Components are the backbone of the application
Moduleimport { Module } from '@crispcode/modux'The Module class. Modules are the main part of modux

Utils classes

NameUsageDescription
approximport { approx } from '@crispcode/modux'Used to approximate a number to a certain number of decimals
Communicationimport { Communication } from '@crispcode/modux'The Communication class, used to handle http requests
Cookieimport { Cookie } from '@crispcode/modux'A static class used to manipulate cookies
DateTimeimport { DateTime } from '@crispcode/modux'A Date class wrapper
Deviceimport { Device } from '@crispcode/modux'A static class used to get device information
extendimport { extend } from '@crispcode/modux'Extends an object with another object
fontimport { font } from '@crispcode/modux'A font loader
htmlimport { html } from '@crispcode/modux'Convert string to html
isNumberimport { isNumber } from '@crispcode/modux'Checks if the value is a number
isObjectimport { isObject } from '@crispcode/modux'Checks if the object is an Object
loaderimport { loader } from '@crispcode/modux'The Loader class is used to preload files
loggerimport { logger } from '@crispcode/modux'A class to mimic window.console
loopimport { loop } from '@crispcode/modux'Loop through a collection Object or Array
radiansimport { radians } from '@crispcode/modux'Convert an angle from degrees to radians
rndimport { rnd } from '@crispcode/modux'Generate a random number between two values
scrollimport { scroll } from '@crispcode/modux'A library used for scrolling window or an element
soundsimport { sounds } from '@crispcode/modux'A class used to manipulate Sounds
uidimport { uid } from '@crispcode/modux'Generates a random unique identifier
Urlimport { Url } from '@crispcode/modux'A class used to manipulate urls

Configuration

You can create a file called modux.config.js in the root of your folder, which needs to contain a function with one parameter and returns an object. The parameter of the function will be filled with the current webpack configuration. This gives the user a chance to modify the default webpack configuration based on their needs.

Change Log

We're using the GitHub releases for changelog entries.