Faster Bug Fixes

Increase the verification done in the code. Support private to be sure your code is used from where it is intented. Support Strong Typing to know when people are sending you garbage. All that lead to faster bug fixes. so better code.

Better Code Monitoring

Thus you measure more accuratly what your code is actually doing. Monitor Garbage Collection. Monitor Global Variables. Monitor all you can. Good measures leads to better decision on which action to take.

Pure 100% Javascript

No new language to learn. No compilation to javascript. Only good old javascript. Javascript is open standard and run everywhere. You can't beat that.


What Better.JS Can Do For You ?

Better Classes

With Better.js, it is possible to pass attributes to class. You can define which functions is private or not, same for properties. You can apply strong typing to arguments and better.js check the validity of each arguments passed to your constructor. You can apply strong typing to properties the same way.

View details

Better Functions

With Better.js, you can define the strong typing for your arguments and better.js check the validity of each arguments passed to your function. It is the same for strong typing for the returned value. If this function is part of a class, you can declare it as private thus only this class will be able to use it.

View details

Better Properties

With better.js you can have strong typing for your properties. So you define the type allowed for your property, and better.js check it everytime the value is modified. If this property is part of a class, you can declare it as private thus only this class will be able to use it.

View details


How To Install It ?

With node.js

npm install better.js

With script

<script src="better.js"></script>

With bower

bower install better.js

Private in Javascript Be sure your code is used from where it is intented.

Better.js adds private/public support to javascript. It is possible to declare a property or a function as private, and Better.js will check it for you. If it is used from outside the class, it will stop immediatly.

// definition of the class
var Cat = function(){
  this._name  = 'kitty'
}
// Make it Better.js with privatize
Cat = Bjs.Class(Cat, {
  privatize : true
})
// Get an instance of this class
var cat = new Cat()
// Try to display a private property from outside
console.log("cat's name is", cat._name)

// Exception Thrown 
// 'access to private property _name'

// Thanks to Better.js!

// In plain javascript, it would silently ignore the 
// issue and display the value

// definition of the function
var add = function(a, b){
  return a + b;
}

// Make it better.js
add = Bjs.Function(add, {
  arguments : [Number, Number],
  return : [Number]
})

// Try to display pass invalid arguments type
add('hello', 'world')

// Exception Thrown 
// 'Invalid argument. it should be a Number'

// Thanks to Better.js!

// In plain javascript, it would silently ignore the
// issue and execute the code.

Strong Typing Detect when people are sending you garbage.

Better.js adds strong typing support to javascript. It is possible to declare the allowed type of each property. If somebody set it to a wrong type, it is stopped immediatly. The same for function arguments, you define the allowed types and better.js will make sure they are respected.

Read More


Our Wonderful Logo



How Much I Love Javascript ? A LOT !


"This is the last thing you gonna see if you mess with javascript!"

Tweet

"Javascript fell from heaven!"

Tweet

"Double Thumbs UP for JavaScript!"

Tweet

"Javascript is Number ONE!"

Tweet

"i love javascript THIIIIISSS much !"

Tweet

Fork me on GitHub
Tweet