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.640latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.640
1.0.630
1.0.620
1.0.610
1.0.600
1.0.580
1.0.570
1.0.560
1.0.550
1.0.540
1.0.530
1.0.510
1.0.490
1.0.480
1.0.471
1.0.460
1.0.450
1.0.440
1.0.430
1.0.420
1.0.410
1.0.400
1.0.390
1.0.380
1.0.360
1.0.340
1.0.330
1.0.321
1.0.310
1.0.300
1.0.291
1.0.280
1.0.270
1.0.260
1.0.230
1.0.220
1.0.210
1.0.200
1.0.190
1.0.180
1.0.170
1.0.160
1.0.150
1.0.140
1.0.130
1.0.120
1.0.110
1.0.100
1.0.77
1.0.40
1.0.20

Package Sidebar

Install

npm i lanurite

Weekly Downloads

10

Version

1.0.64

License

MIT

Unpacked Size

218 kB

Total Files

43

Last publish

Collaborators

  • beget
  • pxyup
  • rx-837