A modular JavaScript library that loads functionality based on HTML attributes, similar to Finsweet's approach. Modules are loaded dynamically only when requested, keeping bundle sizes minimal.
Include the library in your HTML and specify which modules you want to use:
<script async type="module" src="https://cdn.jsdelivr.net/npm/@outseta/attributes@latest/dist/core.js"
o-course
></script>The library uses a modular loading system:
- Core library (
core.js) is lightweight and loads first - Modules are loaded dynamically only when requested via attributes
- No bundling - each module is a separate file for optimal caching
- On-demand loading - only the modules you need are downloaded
o-course- Course management with lesson completion tracking, video auto-completion, and progress indicatorso-list- Dynamic list filtering and display based on user data
npm install
npm run buildThe built files will be in dist/:
core.js- Main library filemodules/- Individual module files
npm run dev # Start development server with watch mode
npm run lint # Run ESLint
npm run format # Run Prettier- Create a new file in
src/modules/ - Use the
Attributes.register()function:
Attributes.register('module-name', function() {
// Your module code here
});- Rebuild with
npm run build
- Outseta: Required for user management
- Modern browsers: ES6+ support required
MIT