![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Invisible is a JavaScript (and CoffeeScript!) library that leverages browserify to achieve the Holy Grail of web programming: model reuse in the client and the server.
First wire up Invisible into your app:
express = require("express");
path = require("path");
invisible = require("invisible");
app = express();
invisible.server(app, path.join(__dirname, "models"))
To make your models available everywhere, define them and call Invisible.createModel
Invisible = require("invisible");
crypto = require("crypto");
_s = require("underscore.string");
function Person(firstName, lastName, email){
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
}
Person.prototype.fullName = function(){
return this.firstName + ' ' + this.lastName;
}
Person.prototype.getAvatarUrl = function(){
cleanMail = _s.trim(this.email).toLowerCase();
hash = crypto.createHash("md5").update(cleanMail).digest("hex");
return "http://www.gravatar.com/avatar/" + hash;
}
module.exports = Invisible.createModel("Person", Person);
Require your models as usual in the server:
Person = require("./models/person");
john = new Person("John", "Doe", "john.doe@mail.com");
john.fullName(); //John Doe
In the client, just add the invisible script and your models will be available under the Invisible namespace:
<script src="invisible.js"></script>
<script>
jane = new Invisible.Person("Jane", "Doe", "jane.doe@mail.com");
alert(jane.fullName()); //Jane Doe
</script>
Invisible extends your models to handle your MongoDB persistence, no matter if you are at the client or the server:
jane.save();
Invisible.Person.query({firstName: "Jane"}, function(results){
console.log(results[0].fullName()); //Jane Doe
});
FAQs
DRY models for client and server
The npm package invisible receives a total of 40 weekly downloads. As such, invisible popularity was classified as not popular.
We found that invisible demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.