0.1.7 • Published 11 years ago
justjs v0.1.7
Update: JustJS had been no longer maintained. Please see the new version of it:
- Github: https://github.com/cherryjs/cherry.js
- Home Page: http://cherryjs.com
JustJS
JustJS is a Javascript Core Library powered by JerryZou. You can use javascript more easily with JustJS. The sample follows:
Just include this script for using:
<script src="JustJs-0.1.7.js"></script>
And enjoy JustJS:
J(function(){
var arr = ['a','b','c','d'];
arr.swap(0,2);
console.log(arr); //return ['c','b','a','d'];
var obj_1 = { a:{b:1}, c:[1,2,3] };
var obj_2 = { a:{b:1}, c:[1,2,3] };
console.log( obj_1===obj_2 ); //return false;
console.log( obj_1.equal(obj_2) ); //return true;
});
If you don't care about polluting the global namespace, you can:
J('bind');
/*
* do anything you want with JustJS
*/
//And when you don't want to use JustJS any more, you can call J('unbind')
J('unbind');
References
Object Methods - methods of Object extended by JustJS Array Methods - methods of Array extended by JustJS String Methods - methods of String extended by JustJS
Use JustJS in your Node.js APP
Install the JustJS module first
npm install justjs
And Call JustJS like this:
var J = require('justjs').J; //or require('justjs').JustJS
J(function(){
...
});