lanurite
TypeScript icon, indicating that this package has built-in type declarations

1.0.64 • Public • Published

Lanurite

Library for Models and Collection use in JS worlds

Documentation: https://pxyup.github.io/lanurite/

NPM

For use in browser

<script src="../dist/lanurite.js"></script>

For use in TypeScript

import * as Lanurite from "lanurite"
console.log(Lanurite.version)
 

For use in NodeJS

var Lanurite = require("lanurite");
console.log(Lanurite.version)

Example

 
let model = new Lanurite.Model({name: "Robot"});
document.getElementById("test").innerHTML = model.get("name");
 
model.on("change", function (e) {
    document.getElementById("test").innerHTML = model.get("name")
    model.off("change", log)
});
 
let collection = new Lanurite.Collection();
 
collection.on("add", function (model) {
    document.getElementById("collection").innerHTML += model.get("name") + "<br>"
})
 
collection.on("clear", function () {
    document.getElementById("collection").innerHTML = "";
});
 
model.on("change", log);
 
collection.on("reset", function () {
    getCollectionDOM();
});
 
getCollectionDOM();
 
function log(event){
    console.log(event)
}
 
function getCollectionDOM() {
    document.getElementById("collection").innerHTML = "";
    collection.each((el) => {
        document.getElementById("collection").innerHTML += el.get("name") + "<br>"
    });
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.648latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.648
1.0.632
1.0.622
1.0.612
1.0.602
1.0.582
1.0.572
1.0.562
1.0.552
1.0.542
1.0.532
1.0.513
1.0.493
1.0.482
1.0.472
1.0.462
1.0.452
1.0.442
1.0.432
1.0.422
1.0.412
1.0.402
1.0.392
1.0.382
1.0.362
1.0.342
1.0.332
1.0.322
1.0.312
1.0.302
1.0.292
1.0.282
1.0.272
1.0.262
1.0.232
1.0.222
1.0.212
1.0.202
1.0.192
1.0.182
1.0.172
1.0.162
1.0.152
1.0.142
1.0.132
1.0.122
1.0.112
1.0.103
1.0.72
1.0.42
1.0.22

Package Sidebar

Install

npm i lanurite

Weekly Downloads

2

Version

1.0.64

License

MIT

Unpacked Size

218 kB

Total Files

43

Last publish

Collaborators

  • beget
  • pxyup
  • rx-837