lively.modules
v0.8.38
Published
JavaScript package and module system for interactive development.
Downloads
57
Readme
lively.modules
JavaScript package and module system for interactive development.
Module and package system
Live and interactive devlopment
Goals
lively.modules provides a framework for loading, defining and interactively modifying JavaScript modules. A module is an entity containing JavaScript source code that adheres to the definition of the ECMAScript Language Specification.
For an intro to the topic see ES6 In Depth: Modules at mozilla.org
Its main purpose is to
- Provide an interface to load modules and groups of modules (packages)
- Provide an interface to access and modify the runtime state of a module, i.e. its
- dependencies (modules imported and modules that import it)
- imported and exported values
- source code
- internal definitions
- Provide a user friendly and practical implementation of how imported modules are resolved *.
- For the purpose of grouping modules together and providing a method for module lookup introduce a lightweight concept of a package.
* The ES specification explicitly leaves the semantics for "HostResolveImportedModule" open to module implementations
For more please see doc/rationale.md.
Usage
To load lively.modules you can use the pre-build
dist/lively.modules-with-lively.vm.js
file. Once that happens the
lively.modules
global will provide an interface for loading packages,
modifying modules, evaluating source code in module contexts etc.
So on a webpage you would typically link via
<script src="../node_modules/lively.modules/dist/lively.modules-with-lively.vm.js"></script>
See the examples in lively-system-examples for more details.